Gan*_*row 43 javascript jquery
点击某个锚时,我希望我的页面转到顶部.
这是我试图这样做但它不起作用,它滚动速度超快.
$('a[href=#top]').click(function () {
$('body').animate({
scrollTop: 0
},
50);
});
Run Code Online (Sandbox Code Playgroud)
我想放慢速度.
ant*_*ant 104
$('a[href=#top]').click(function(){
$('html, body').animate({scrollTop:0}, 'slow');
});
Run Code Online (Sandbox Code Playgroud)
也许?