首页 > 技术文档 > 技术文档 > 底部跟随栏

底部跟随栏

时间:2012-3-23 已查看2553次

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>底部跟随栏</title>
</head>
<body>
<style type="text/css" rel="stylesheet">
#rollingbar
{
    background:url(gdbg.gif) 0px 0px repeat-x #FFF;
    height:29px;
    line-height:29px;
    border-top:1px solid #9FB0BD;
    position:absolute;
    width:100%;
    overflow:hidden;
    z-index:1000;
}
</style>
<div style="left: 0px; top: 3599px;" id="rollingbar">提示:你好吗?</div>
<script language="javascript">
function rollingbar()
{
    var SnRn=document.getElementById("rollingbar");
    if(!window.pageYOffset){
        var scrollTop =  document.documentElement.scrollTop;
    }else{
        var scrollTop=window.pageYOffset;
    }
    SnRn.style.top=document.documentElement.clientHeight+scrollTop-29+"px";
}
setInterval(rollingbar,100); 
</script>
</body>
</html>

上一篇:阿里安全称发现安卓WiFi漏洞:黑客可远程攻击 下一篇:优化PHP程序的方法