Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  9] [ 7]  / answers: 1 / hits: 103191  / 15 Years ago, sat, january 23, 2010, 12:00:00

I'd like my page to go to the top when certain anchor is clicked.



Here is how I tried to do it but it's not working, it's scrolling super fast.



 $('a[href=#top]').click(function () {
$('body').animate({
scrollTop: 0
},
50);
});


I want to slow it down.


More From » jquery

 Answers
-1
$('a[href=#top]').click(function(){
$('html, body').animate({scrollTop:0}, 'slow');
});


Perhaps?


[#97768] Tuesday, January 19, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skylerselenem

Total Points: 282
Total Questions: 101
Total Answers: 107

Location: Nicaragua
Member since Tue, Dec 8, 2020
4 Years ago
;