Any idea why the following javascript would not work properly after upgrading from WordPress 3.9.1/Views 1.5.1 to WordPress 4.0/Views 1.6.4?
jQuery(document).on('click','.wpv-filter-previous-link,.wpv-filter-next-link', function() {
$('html, body').animate({
scrollTop: ($('.filter-submit').offset().top)
},500);
});
And by "not working properly" I mean that when clicking on the "wpv-filter-previous-link" or "wpv-filter-next-link" the page scrolls to a random point on the page and it is not nice and smooth, just quick and sudden. Where as before it would perform a nice smooth scroll to the specified button with the "filter-submit" class.
Any help would be appreciated.
Since it is a custom java-script problem, could you post a live problem URL for it? I need test it in my Chrome browser. thanks
Unfortunately it's on a member only/password restricted site so I'm not able to provide an example. Any other ideas?
Could you duplicate same problem with discover-wp.com. I need a live website to debug this problem
How and why to create a test site in Discover-WP
https://toolset.com/faq/how-and-why-to-create-a-test-site-in-discover-wp/
Ah, yes, I'd forgotten about that site. I will try to duplicate this and let you know when it's done.
Hey, Luoy, any way I can send you a private message?
Please fill below private detail box with login details of your test site,
also point out the problem page URL, thanks
I have edited the problem view:
hidden link
1) in section "Layout HTML/CSS/JS", modify the JS codes as below:
function Pagination_Callback(){
jQuery(document).ready(function($){
$('.wpv-filter-previous-link,.wpv-filter-next-link').on('click',function(event){
$('html, body').animate({
scrollTop: ($('.scroll-to-here').offset().top)
},700);
});
});
}
Pagination_Callback();
It will create a JS function "Pagination_Callback"
2) in section "Pagination and Sliders settings", click "Advanced options" button, fill the option "Callback function" with above function name "Pagination_Callback"
Please check if it is what you needed.
Sorry for the delay in getting back to you, I was away for a bit. Thank you very much for your help, it was right on, as usual and everything works great now. Thank you!