您的位置:首页 > 其它

页脚固定页面底部

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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  DIV设计