随鼠标上下滚动的jquery代码
内容摘要
复制代码 代码如下: //随鼠标上下滚动 $(window).bind('scroll resize',function(){ $('#sidebar').stop(true, true).animate({ 'top': $(document).scrollTop() + 'px' },
文章正文
复制代码 代码如下:
//随鼠标上下滚动
$(window).bind('scroll resize',function(){
$('#sidebar').stop(true, true).animate({
'top': $(document).scrollTop() + 'px'
},500);
}).scroll().resize();
代码注释