I am trying to:
Make the scroll animation of the Views pagination work properly, when the pagination is inserted into the Views Output, instead of the Views Filter Output.
Link to a page where the issue can be seen:
hidden link
I expected to see:
When I use the lower pagination control (which is the one I want to use), there is a scroll up animation, which is not heading to the top of the section but to the middle, also if you click to the last page (n 13) the page scroll down out of the Views product section, this should scroll up too.
I've already opened a thread with this topic, but it has been closed after few days, for lack of answer... (by another supporter) please can we fix it this time.
Hi, I recommend adding some JavaScript in your View that will scroll the page up to the top of the results again. Go into your View and underneath the Loop Output editor you will see a JS panel. Toggle it open, then paste the following code into the editor:
jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
jQuery("html, body").animate({ scrollTop: (jQuery('.js-wpv-filter-form').first().offset().top - 30) }, 1000);
});
Save this code and retest your View. You can tweak the final animation position by increasing or decreasing the number 30 as desired. Please let me know if this does not resolve the issue to your satisfaction.