<div class="codetitle"> <span><a style="CURSOR: pointer" data="99001" class="copybut" id="copybut99001" onclick="doCopy('code99001')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code99001"> <br><script type="text/javascript"> <BR>$.fn.silde = function() { <BR>var position = function(element) { <BR>var top = element.position().top, pos = element.css <BR>("position"); <BR>$(window).scroll(function() { <BR>var scrolls = $(this).scrollTop(); <BR>if (scrolls > top) { <BR>if (window.XMLHttpRequest) { <BR>element.css({ <BR>position: "fixed", <BR>top: 0, <BR>left:1080, <BR>"margin-left":"0px", <br><br>}); <BR>} else { <BR>element.css({ <BR>top: scrolls, <BR>"margin-left":"20px" <BR>}); <BR>} <BR>}else { <BR>element.css({ <BR>position: pos, <BR>top: top, <BR>"margin-left":"20px" <BR>}); <BR>} <BR>}); <BR>}; <BR>return $(this).each(function() { <BR>position($(this)); <br><br>}); <BR>}; <BR>$("#ding").silde(); <BR></script> <br> </div>