Skip Navigation

[Resolved] With pagination I want to go to top of next page and not bottom

This support ticket is created 4 years, 7 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 3 replies, has 2 voices.

Last updated by Shane 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1359039

Tell us what you are trying to do?
On the bottom of the page is the pagination. When you pick a next page, the pagination (bottom of the page) is the start of the new page. So visitors first have to scroll to top to start reading. I like it when visiters go to the top of the next page using pagination

With kind regards

Karin

What is the link to your site?
hidden link

#1359189

Shane
Supporter

Languages: English (English )

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

Hi Karin,

Thank you for getting in touch.

What you need is a function that will scroll you back to the top of the page or to a div when you paginate.

Add this div to your view.

<div class='scroll'></div>

Then add this jquery to the js editor of your view.

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.effect (string) The View AJAX pagination effect
	* data.speed (integer) The View AJAX pagination speed in miliseconds
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
	  jQuery('html, body').animate({
        scrollTop: jQuery(".scroll").offset().top
    }, 2000);
});

Please let me know if this helps.

Thanks,
Shane

#1359419

The code in this pages looks better than the code in the mail 😉
But it doesn't work. When i go to another page in pagination, I still stay at pagination at the bottom.
I have the pagination set in my view, because otherwise the filtering won't work. Can that be the issue.
The default pagination is out of site with a display:none
This is the pagination that is in sight for the visitors:
<center>
<div class="pagineren"> [wpv-pager-archive-nav-links output="bootstrap" first_last_links="true"]</div></center>

#1359727

Shane
Supporter

Languages: English (English )

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

Hi Karin,

Would you mind allowing me to have admin access to the site so that I can check on this for you ?

Also please let me know the page that the view is on so that I can check this out for you.

Thanks,
Shane

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