Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1489523

    Dear support,
    i tried this solution to avoid the scroll to top, when clicking the next page button. But it does not work. Is there any other solution which works?
    Thanks and Regards

    //avoid scroll to top when clickin next page
    
    function add_custom_script(){
    ?>
    <script type="text/javascript">
    (function($){
    function b(id) {
    		$('.pagination .inactive').click(function(e) {
    			e.preventDefault();
    
    			var section = $(id),
    				link = $(this).attr('href'),
    				anchor = $(section ).attr('id');
    
    				if(!section.length) return;
    
    				var link = link + '#' + anchor;
    				window.location.href = link;
    		});
    	}
            
            $(document).ready( function() {
                b('#referenzen');
            });
    })(jQuery);
    </script>
    <?php 
    }
    add_action('wp_footer', 'add_custom_script');
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.