页脚固定页面底部
2012-11-18 10:58
225 查看
页脚固定页面底部 页面滚动也是底部 OK
<title>固定在页面底部的滚动公告</title>
<style type="text/css">
html,body,div ul{margin:0;padding:0;border:0; font-size:12px}
#gg{position:fixed;bottom:0;background:#000;width:100%;height:23px;z-index:9999;opacity:.60;filter:alpha(opacity=40);_bottom:auto;_width:100%;_position:absolute;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}
#gg a {color:#FFF}
</style>
<script type="text/javascript">
(function($){
$.fn.extend({
Scroll:function(opt,callback){
if(!opt) var opt={};
var _this=this.eq(0).find("ul:first");
var lineH=_this.find("li:first").height(),
line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10),
speed=opt.speed?parseInt(opt.speed,10):3000,//卷动速度,数值越大,速度越慢(毫秒)
timer=opt.timer?parseInt(opt.timer,10):3000;//滚动的时间间隔(毫秒)
if(line==0) line=1;
var upHeight=0-line*lineH;
scrollUp=function(){
_this.animate({
marginTop:upHeight
},speed,function(){
for(i=1;i<=line;i++){
_this.find("li:first").appendTo(_this);
}
_this.css({marginTop:0});
});
}
_this.hover(function(){
clearInterval(timerID);
},function(){
timerID=setInterval("scrollUp()",timer);
}).mouseout();
}
})
})(jQuery);
$(document).ready(function(){
$(".bulletin").Scroll({line:1,speed:500,timer:3000});//修改此数字调整滚动时间
});
</script>
</head>
<body>
<div style="text-align:center;">
<ul><li>1</li></ul>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
<ul><li>3</li></ul>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>123123123<br>
123123123<br>123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
<ul><li>4</li></ul>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>123123123<br>
123123123<br>123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
<ul><li>5</li></ul>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>123123123<br>
123123123<br>
</div>
<div id="gg"><a href="/">固定在页面底部的滚动公告</a></div>
</body>
</html>
<title>固定在页面底部的滚动公告</title>
<style type="text/css">
html,body,div ul{margin:0;padding:0;border:0; font-size:12px}
#gg{position:fixed;bottom:0;background:#000;width:100%;height:23px;z-index:9999;opacity:.60;filter:alpha(opacity=40);_bottom:auto;_width:100%;_position:absolute;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}
#gg a {color:#FFF}
</style>
<script type="text/javascript">
(function($){
$.fn.extend({
Scroll:function(opt,callback){
if(!opt) var opt={};
var _this=this.eq(0).find("ul:first");
var lineH=_this.find("li:first").height(),
line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10),
speed=opt.speed?parseInt(opt.speed,10):3000,//卷动速度,数值越大,速度越慢(毫秒)
timer=opt.timer?parseInt(opt.timer,10):3000;//滚动的时间间隔(毫秒)
if(line==0) line=1;
var upHeight=0-line*lineH;
scrollUp=function(){
_this.animate({
marginTop:upHeight
},speed,function(){
for(i=1;i<=line;i++){
_this.find("li:first").appendTo(_this);
}
_this.css({marginTop:0});
});
}
_this.hover(function(){
clearInterval(timerID);
},function(){
timerID=setInterval("scrollUp()",timer);
}).mouseout();
}
})
})(jQuery);
$(document).ready(function(){
$(".bulletin").Scroll({line:1,speed:500,timer:3000});//修改此数字调整滚动时间
});
</script>
</head>
<body>
<div style="text-align:center;">
<ul><li>1</li></ul>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
<ul><li>3</li></ul>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>123123123<br>
123123123<br>123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
<ul><li>4</li></ul>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>123123123<br>
123123123<br>123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
<ul><li>5</li></ul>
123123123<br>
123123123<br>
123123123<br>
123123123<br>
123123123<br>123123123<br>
123123123<br>
</div>
<div id="gg"><a href="/">固定在页面底部的滚动公告</a></div>
</body>
</html>
相关文章推荐
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面的底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 【转载自W3CPLUS】如何将页脚固定在页面底部
- 将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部(多种方法实现)
- Css Sticky Footer将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部,4中方法 转载自:W3CPLUS
- 如何将页脚固定在页面底部
- JS实现让页脚一直固定在页面底部
- 通过jQuery来实现页脚永远固定在页面底部的效果
- 如何将页脚固定在页面底部(sticky footer)
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部