帮忙写一段文字上下滚动的jquery代码

2025-04-14 14:52:18
推荐回答(2个)
回答1:

$(window).bind('scroll resize',function(){
$('#sidebar').stop(true, true).animate({
'top': $(document).scrollTop() + 'px'
},500);
}).scroll().resize();

回答2:

$(".content-info").animate({top:'-=20px'})    //向上滚动
$(".content-info").animate({down:'-=20px'})   //向下滚动