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

底部固定栏目有时还是蛮需要的,有些浏览器兼容性不是很好
又来整个,表示可以实现。
jquery博客实现底部固定类似人人校内似的,只是个模糊状态
具体还是要慢慢写的。
<STYLE type=text/css>
*{margin:0;padding:0}
.fixed {RIGHT: 15px; BACKGROUND: #ccc; LEFT: 15px; BOTTOM: 0; LINE-HEIGHT: 30px; POSITION: fixed; HEIGHT: 30px
}
#iefixed {
MARGIN: -1px 15px 0px; OVERFLOW: hidden; ZOOM: 1; HEIGHT: 1px
}
</STYLE>
<!--[if lt IE 7]>
<script type="text/javascript">
function _fixBackground(){
var body = document.body;
var BLANK_GIF;
if (body.currentStyle.backgroundAttachment != "fixed") {
if (body.currentStyle.backgroundImage == "none") {
body.runtimeStyle.backgroundImage = "url("+BLANK_GIF+")"; // dummy
body.runtimeStyle.backgroundAttachment = "fixed";
}
}
}
window.onload = function(){
_fixBackground();
}
</script>
<style type="text/css">
.fixed{
position: absolute;
bottom: auto;
clear: both;
width:expression(document.getElementById('iefixed').clientWidth);
left:expression(document.getElementById('iefixed').offsetLeft);
top:expression(eval(document.compatMode &&
document.compatMode=='CSS1Compat') ?
documentElement.scrollTop
+(documentElement.clientHeight-this.clientHeight)
: document.body.scrollTop
+(document.body.clientHeight-this.clientHeight));
}
</style>
<![endif]-->

在线效果DEMO

转自 jquery http://www.jqueryba.com/396.html

posted @ 2012-11-24 13:03  遗失的天空  阅读(152)  评论(0编辑  收藏  举报