Sunday, 25 August 2013

How do I fix this click function to move to a particular location slowly?

How do I fix this click function to move to a particular location slowly?

Code:
$(document).ready(function()) {
$('a').click(function(){
$('html, body').animate({'scrollTop' :
$($(this).attr('href')).offset().top}
, 100000);
return false;
})
});
On click the script is supposed to slowly move the location on the page.
For some reason it's not working at all. I am new to JS so not sure what I
am missing. Any ideas?

No comments:

Post a Comment