Sauter la navigation

[Résolu] Auto Scroll Not Working

This support ticket is created Il y a 4 années et 10 mois. 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)

Marqué : 

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par Pete Il y a 4 années et 10 mois.

Assisté par: Shane.

Auteur
Publications
#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
lien caché

But not on this
lien caché

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 lien caché and also lien caché

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

Les langues: Anglais (English )

Fuseau horaire: 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!