Этот JS создает Smooth-свиток, он работает с jQuery 1.11.1, но прерывается с jQuery 1.12.3. Используя это с сайтом Wordpress и предпочитайте не загружать две версии jQuery.Smooth scroll JS, работающий с jQuery 1.11.1, но перерыв с jQuery 1.12.3
Невозможно выяснить, что обновить, чтобы заставить его работать снова.
<!--smooth scroll to anchors-->
<script>
(function($){
var jump=function(e){
if (e){
e.preventDefault(); //prevent the "normal" behavior which would be a "hard" jump
var mytarget = $(this).attr("href"); //get the target
}else{
var mytarget = location.hash; //sets the target to the anchor part of a URL
}
$('html,body').animate( //perform animated scrolling
{
scrollTop: $(mytarget).offset().top - 100 //get top-position of target-element and set it as scroll target and move down 100px for fixed nav
}, 1000,function(){ //scrolldelay: 2 seconds
location.hash = mytarget; //attach the hash (#jumptarget) to the pageurl
});
}
$('html, body').hide()
$(document).ready(function(){
$('a[href^=#]').bind("click", jump);
if (location.hash){
setTimeout(function(){
$('html, body').scrollTop(0).show()
jump()
}, 0);
}else{
$('html, body').show()
}
});
})(jQuery)
</script>
<!--End smooth scroll-->
Есть ли ошибки в консоли? – Andy