Skip Navigation

[Resolved] Archive Page Scroll to Top

This thread is resolved. Here is a description of the problem and solution.

Problem:
Archive Page Scroll to Top

Solution:
You will have to add the custom JS workaroun and add it to yoru archive's JS box.

You can find the proposed solution in this case with the following reply:
https://toolset.com/forums/topic/archive-page-scroll-to-top/#post-2364371

Relevant Documentation:

This support ticket is created 2 years, 9 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 3 voices.

Last updated by Pete 2 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#2363901
aa screen 15-3.png

Hi there,

We're just setting up some archive pages, never used them much in the past.

Can I ask, how to we achieve scroll to top when pagination is clicked?
We'd prefer not to have a full page reload and use the Ajax function on all our Views.

All our Views have a scroll to top action however anything I try wont work.
And I presume any code go's in the Callback Function, this under Spinners in the sidebar panel?

Better still...is there an infinite scroll option?

This a sample page we're working on:
hidden link

Many thanks in advance.

#2364241

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2022-05-16 at 08.35.44.png

> Better still...is there an infinite scroll option?

Yep. See the pagination settings in the sidebar. When you choose manual ajax updates for pagination, you have infinite scroll as an option.

#2364323

Hi Nigel,

Thank you for that.

Ok Infinite scrolling when we may have so many posts may not be right for us.

I'm aware of scroll to top codes, as mentioned we already use this for other Views.

Is there one for this?
hidden link

Really like the slide horizontally effect, it just needs to scroll to top, which is really odd this isn't part of the basic function.

Thank you.

#2364371

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Try adding the following to the custom JS section of the archive block settings:

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

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please try to follow the solution shared by Nigel and check if that help you to resolve your issue.

#2365239

My issue is resolved now. Thank you!