Skip Navigation

[Resolved] Views pagination with Ajax reloads whole page instead

This support ticket is created 8 years, 2 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
- 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 -
- - - - - - -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 19 replies, has 4 voices.

Last updated by samB-3 8 years, 2 months ago.

Assisted by: Adriano.

Author
Posts
#373024

Unfortunately I didn't keep any of my attempts to make this work and just set the script back to the original till I could get it resolved. But I guess I just need help modifying this script with what Bob suggested so that it works:

jQuery(document).on('click','.wpv-filter-previous-link,.wpv-filter-next-link', function() {
$('html, body').animate({
    scrollTop: ($('.filter-submit').offset().top)
},700);
});

Is that something you can help with or should I post elsewhere and ask for help? I understand if you can't.

#373073

Bob

Hi Sam,
Adriano's possibly gone for the weekend now.

Try the following:

In the JS section of your view...

jQuery(document).on( 'js_event_wpv_pagination_completed', function() {
jQuery('html, body').animate({
    scrollTop: jQuery('#scroll-div').offset().top
},700);
});

Note: Don't use the $ shortcut for jQuery.

To set the scroll position set the id on an element in your view html which defines the top of the scroll visibility area.

If you don't have an existing element you can just add a new (hidden) one with the id...

<div id="scroll-div" style="display: none;"></div>

Hope that works for you.

Cheers,

Bob

#373446

Thank you @bob.

@sam, let us know how it goes.

#373452

Bob

Sam,
I should not have set the div style to display: none; in the sample code above.
So put your id in an existing element or add a new element but don't make the style display: none;

Cheers,

Bob

#373610

Ah, that was it. Thank you Bob and Adriano! I tried lots of different combinations so I'm not sure exactly what I did wrong but I know I wasn't aware to not use the $ shortcut for jQuery so that may have been it ... I'm not very good with JS.

Thank you very much for your help!

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