时间:2021-07-21人气:-
<style type="text/css">.floatnv{position:fixed;_position:absolute;top:0px;z-index:999;width:100%;}</style><script language="javascript" type="text/javascript"> (function() { var oDiv = document.getElementById("nv"); var H = 0, iE6; var Y = oDiv; while (Y) { H += Y.offsetTop; Y = Y.offsetParent; }; iE6 = window.ActiveXObject && !window.XMLHttpRequest; if (!iE6) { window.onscroll = function() { var s = document.body.scrollTop || document.documentElement.scrollTop; if (s > H) { oDiv.className = "floatnv"; if (iE6) { oDiv.style.top = (s - H) + "px"; } } else { oDiv.className = ""; } } } })();</script>document.getElementById("nv");对应的是id="nv"的元素。