CSS样式定位页面,大多数是定位导航栏;
1、第一把下面js拷贝到代码页面;
2、第二把以下写的css样式拷贝到对应的样式里面;
3、第三把以下写的
if (typeof (bitLoadScript) == "undefined")
bitLoadScript = function (url, callback, charset) {
var s = document.createElement("script"); s.type = "text/javascript"; if (charset) s.charset = charset;
if (s.readyState) { s.onreadystatechange = function () { if (s.readyState == "loaded" || s.readyState == "complete") { s.onreadystatechange = null; if (callback) callback(); } }; }
else { s.onload = function () { if (callback) callback(); }; }
s.src = url; document.getElementsByTagName("head")[0].appendChild(s);
};
- 这里是填写需要定位的代码
.bb{width:100%;height:185px;background:#fff;
z-index:2; margin:0px auto;position:fixed !important; top:0px;
position:absolute; top:expression(offsetParent.scrollTop+0);}
详见例子:http://www.shouyin120.org/meitibaodao/2012071999.html