Hi, I have a page with multiple Views in one page, and each have pagination using AJAX, I am using a the frontend events on each Views to scroll to their respective top using this code as example in one of my Views:
jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
if( data.view_unique_id === 331){
$('html, body').animate({
scrollTop: $(".pub-anchor").offset().top
}, "fast");
}
});
But it doesn't work, do you know what went wrong with that?
Thanks
Hi,
Thank you for contacting us and I'd be happy to assist.
To troubleshoot this, I'll need to see how these views are set up in the admin area. Can you please share temporary admin login details, along with the exact steps to see the issue?
Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.
regards,
Waqar
Thank you for sharing the access details.
The value of the 'data.view_unique_id' is not equal to the view's ID, but it does start with it.
I've updated the custom script accordingly and it is working, now:
jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
if (data.view_unique_id.match("^331-")) {
jQuery('html, body').animate({ scrollTop: (jQuery(".pub-anchor").offset().top) - 250 }, 'slow');
}
});
Hi Waqar, thank you my Issue is resolved!