Answer the question
In order to leave comments, you need to log in
Why does JavaScript work in jsfiddler but not on the site?
jsfiddle.net/mixailhr/p4vdanuk
Answer the question
In order to leave comments, you need to log in
You have the following code on your site
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
$('a[href*=#]:not([href=#])').click(function(e) {
if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
e.preventDefault();
}
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question