jquery博客实现底部固定类似人人校内似的

来源:岁月联盟 编辑:exp 时间:2012-06-01

底部固定栏目有时还是蛮需要的,有些浏览器兼容性不是很好
又来整个,表示可以实现。
jquery博客实现底部固定类似人人校内似的,只是个模糊状态
具体还是要慢慢写的。
1. <STYLE type=text/css>
2. *{margin:0;padding:0}
3. .fixed {RIGHT: 15px; BACKGROUND: #ccc; LEFT: 15px; BOTTOM: 0; LINE-HEIGHT: 30px; POSITION: fixed; HEIGHT: 30px
4. }
5. #iefixed {
6.  MARGIN: -1px 15px 0px; OVERFLOW: hidden; ZOOM: 1; HEIGHT: 1px
7. }
8. </STYLE>
9. <!--[if lt IE 7]>
10. <script type="text/javascript">
11.             function _fixBackground(){
12.     var body = document.body;
13.     var BLANK_GIF;
14.                 if (body.currentStyle.backgroundAttachment != "fixed") {
15.                     if (body.currentStyle.backgroundImage == "none") {
16.                         body.runtimeStyle.backgroundImage = "url("+BLANK_GIF+")"; // dummy
17.       body.runtimeStyle.backgroundAttachment = "fixed";
18.                     }
19.                 }
20.             }
21.    window.onload = function(){
22.     _fixBackground();
23.     }
24.         </script>
25.         <style type="text/css">
26.          .fixed{
27.             position: absolute;
28.     bottom: auto;
29.     clear: both;
30.     width:expression(document.getElementById('iefixed').clientWidth);
31.  left:expression(document.getElementById('iefixed').offsetLeft);
32.     top:expression(eval(document.compatMode &&
33.         document.compatMode=='CSS1Compat') ?
34.         documentElement.scrollTop
35.         +(documentElement.clientHeight-this.clientHeight)
36.         : document.body.scrollTop
37.         +(document.body.clientHeight-this.clientHeight));
38. }
39.         </style>
40.  <![endif]-->
 

 


摘自 天外飞仙