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/
JavaScript
x
8
1
var $root = $('html, body');
2
$('a').click(function() {
3
$root.animate({
4
scrollTop: $( $(this).attr('href') ).offset().top
5
}, 500);
6
return false;
7
});
8
Advertisement
Answer
remove overflow-x: hidden;
and it will work
See here http://jsfiddle.net/acidrat/Wt2rp/1/