第1个回答 2014-11-05
css中定位设置成position: fixed;就能实现 不需要jqery吧
用jquery的话
window.onscroll=function(){
if($(document).scrollTop()>566){
$("#biandong_right").attr('class',"biandong_right1")
$("#biandong_right_wai").css('position','fixed').css('top','60px')
$('#a1').show()
}
if($(document).scrollTop()<566){
$("#biandong_right").attr('class',"biandong_right")
$("#biandong_right_wai").css('position','')
$('#a1').hide()
}
}
其实也是用jquery改变css本回答被提问者和网友采纳