Skip Navigation

[Resolved] Auto Scroll Not Working

This support ticket is created 4 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Pete 4 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1706761

Hi there,

Toolset support kindly supplied me with code to add to make our grids auto scroll to the top when clicking a pagination button...

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
jQuery('html, body').animate({ scrollTop: (jQuery(".js-wpv-view-layout-32784").offset().top) - 180 }, 'slow');
});

The issue, this working fine on this View
hidden link

But not on this
hidden link

The View in question is a clone of the first, the only difference is the bottom one uses a shortcode to add to the page is its results are URL based.

The issue may be, one View is working hidden link and also hidden link

All using shortcode: [wpv-view name="destination" wpv-destination="norfolk" view_display="layout"] I change the destination to the location I need.

I guess the auto scroll code is having an issue however its js-wpv-view-layout-32784 is set to the one view powering both.

A bit stuck as to what do do ref this.

Many thanks.

#1707141

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Pete,

Thank you for getting in touch.

If you want this code to work on your other views you need to add it like this.

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
jQuery('html, body').animate({ scrollTop: (jQuery(".js-wpv-view-layout").offset().top) - 180 }, 'slow');
});

Setting it to a class that is common to all the views. When you use the class .js-wpv-view-layout-32784 the code is going to look for this class to scroll to. However given that this view is not on the page then it won't be able to scroll to it.

Please try this and let me know if it helps.

Thanks,
Shane

#1707151

My issue is resolved now. Thank you!