清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
<script type="text/javascript"> var margintop = $("#header").offset().top //var marginleft = $("#header_cont").offset().left; //alert(margintop) //alert(marginleft) $(window).scroll(function() { var scrtop = $(document).scrollTop(); if(scrtop<margintop){ $('#header').css({ position: 'absolute', top: margintop, left:'0' }); return false; } $('#header').css({ position: 'absolute', top: scrtop, left:'0' }); }); </script>