jquery实现当滑动到一定位置时固定效果
<scripttype="text/javascript">
$.fn.silde=function(){
varposition=function(element){
vartop=element.position().top,pos=element.css
("position");
$(window).scroll(function(){
varscrolls=$(this).scrollTop();
if(scrolls>top){
if(window.XMLHttpRequest){
element.css({
position:"fixed",
top:0,
left:1080,
"margin-left":"0px",
});
}else{
element.css({
top:scrolls,
"margin-left":"20px"
});
}
}else{
element.css({
position:pos,
top:top,
"margin-left":"20px"
});
}
});
};
return$(this).each(function(){
position($(this));
});
};
$("#ding").silde();
</script>
热门推荐
9 简短元宵节祝福语
10 客户祝福语事业文案简短
11 图书馆简短祝福语
12 爷爷生日会祝福语简短
13 保洁阿姨送来祝福语简短
14 生日祝福语简短女友英语
15 社团迎新祝福语简短英语
16 冬泳祝福语简短8字
17 升班祝福语简短10字
18 给兄长的祝福语简短