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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…