开发者

How do I make the window scroll on mousedown, using jQuery?

I was just wondering why this isnt working:

$('#down-a-bit').mousedown(function(){
    setTimeout( $('html, body').animate({ scrollTo开发者_开发技巧p: $(this).offset().top += 1}) ,300); 
});

What am I doing wrong? Any help would greatly be appreciated, Thanks


You can use .delay instead of setTimeout. If you use setTimeout, wrap it in a function.

http://jsfiddle.net/pMTsF/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜