Skip Navigation

[Resolved] Auto scroll back to the top of the page after pagination (Callback Function)

This support ticket is created 2 years, 11 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)

This topic contains 9 replies, has 2 voices.

Last updated by peterB-20 2 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#2046283

Tell us what you are trying to do? I like to receive some help by finding the right callback function for Auto scroll back to the top of the page after pagination for next, previous, first, last and the present pages.

Is there any documentation that you are following? I have found three old support tickets but these doesn't help out

Is there a similar example that we can see? yes, see the test page hidden link pagination at the bottom

What is the link to your site? hidden link

Thanks
Peter

#2046703

Shane
Supporter

Languages: English (English )

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

Hi Peter,

Add this js to your view and it should work.

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
	jQuery('html, body').animate({ scrollTop: 0 }, 'fast');

});

Please let me know if this helps.
Thanks,
Shane

#2046739

Hi Shane,

Thanks for your quick reply. Unfortunately this doesn't work, I found the same solution in your post of a couple months ago and had already tried it. Troed it again to be sure but no result.

The used theme is Divi and I have disabled WP Rocket and Redis cache to be sure we no interference there. The Toolset plugin for the view I have used is Toolset Blocks.

What more information do you need?

Peter

#2046913

Shane
Supporter

Languages: English (English )

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

Hi Peter,

I added the code to the JS console on the site as a test and it worked.

Could you provide me with admin access to the site so that I can see why this isn't working ?

I've enabled the private fields for your next response.

Thanks,
Shane

#2048189

Hi Shane,

Sorry for that, your IP and country are unblocked. I have blocked all countries incl. the US because it is a dev site.

BR
Peter

#2048191

Shane
Supporter

Languages: English (English )

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

Hi Peter,

Thank, but it would appear that i'm still blocked.

Can you disable the plugin temporarily?

Thanks,
Shane

#2048249

Hi Shane,

Sorry again, you are in Jamaica I thought the US .....I have unblocked your country now. I trust it will work.

BR
Peter

#2048261

Shane
Supporter

Languages: English (English )

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

Hi Peter,

I've added the code to the JS editor for the view and it works fine. You can check the link below and you should see it working.
hidden link

Thanks,
Shane

#2048281

Hi Shane,

Perfect thanks, I see ....the JS editor does the work. I had added the code in the call back function.
This works as a charm.

Cheers
Peter

#2048283

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.