欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery實(shí)現(xiàn)當(dāng)滑動(dòng)到一定位置時(shí)固定效果

 更新時(shí)間:2014年06月17日 10:23:20   投稿:whsnow  
這篇文章主要介紹了jquery實(shí)現(xiàn)當(dāng)滑動(dòng)到一定位置時(shí)固定效果,需要的朋友可以參考下
復(fù)制代碼 代碼如下:

<script type="text/javascript">
$.fn.silde = function() {
var position = function(element) {
var top = element.position().top, pos = element.css
("position");
$(window).scroll(function() {
var scrolls = $(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>

相關(guān)文章

最新評(píng)論