Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
109
rated 0 times [  111] [ 2]  / answers: 1 / hits: 16410  / 10 Years ago, fri, may 2, 2014, 12:00:00

I'm attempting to create a smooth scrolling page, but it seems to not work. If I remove the smooth scrolling aspect of my site, the anchor automatically jumps to the div element like usual.



I have attached a JSFiddle: http://jsfiddle.net/J7sxD/5/



var $root = $('html, body');
$('a').click(function() {
$root.animate({
scrollTop: $( $(this).attr('href') ).offset().top
}, 500);
return false;
});

More From » jquery

 Answers
18

remove overflow-x: hidden; and it will work



See here http://jsfiddle.net/acidrat/Wt2rp/1/


[#71206] Wednesday, April 30, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
agustindejonm

Total Points: 738
Total Questions: 84
Total Answers: 84

Location: Northern Ireland
Member since Mon, Nov 14, 2022
2 Years ago
agustindejonm questions
Fri, Jun 25, 21, 00:00, 3 Years ago
Fri, Sep 18, 20, 00:00, 4 Years ago
Sat, May 16, 20, 00:00, 4 Years ago
;