zoukankan      html  css  js  c++  java
  • 符合标准的随滚动条滚动的广告代码,在滚动条右侧滚动

    网页特效代码:符合标准的随滚动条滚动的广告代码,在滚动条右侧滚动

    <!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=gb2312" />
    <title>符合标准的随滚动条滚动的广告代码dwww.cn</title>
    </head>
    <body>
    <div id="sorollDiv1" style="30px; height:50px; background-color:#0000ff; right:10px;position:absolute;top:120px;"></div>
    <script type="text/javascript">
    var lastScrollY=0;
    function heartBeat(){
    diffY=document.documentElement.scrollTop;
    percent=0.1*(diffY-lastScrollY);
    if(percent>0)percent=Math.ceil(percent);
    else percent=Math.floor(percent);
    document.getElementById("sorollDiv1").style.top=parseInt(document.getElementById("sorollDiv1").style.top)+percent+"px";
    lastScrollY=lastScrollY+percent;
    }
    window.setInterval("heartBeat()",1);
    </script>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    </body>
    </html>
  • 相关阅读:
    Linux下守护进程的编程实现(转)
    gcc 中-I、 -L 与-l选项的作用
    va_list 、va_start、 va_arg、 va_end 使用说明
    sizeof('a')在C与C++中的区别
    Qt主要类简介
    linux命令
    linux文件编程
    linux一些基本命令
    Linux主机SSH免密设置解析
    javaweb添加拦截器
  • 原文地址:https://www.cnblogs.com/JensonBin/p/1908304.html
Copyright © 2011-2022 走看看