zoukankan      html  css  js  c++  java
  • 符合标准的正常工作的对联广告不用删除W3C标准,实用与qq在线客服

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>符合标准的正常工作的对联广告</title>
    <script type="text/javascript">
    <!-- 
    lastScrollY = 0;
    function heartBeat(){ 
    var diffY;
    if (document.documentElement && document.documentElement.scrollTop)
     diffY = document.documentElement.scrollTop;
    else if (document.body)
     diffY = document.body.scrollTop
    else
        {/*Netscape stuff*/}
     
    //alert(diffY);
    percent=.1*(diffY-lastScrollY); 
    if(percent>0)percent=Math.ceil(percent); 
    else percent=Math.floor(percent); 
    document.getElementById("leftDiv").style.top = parseInt(document.getElementById("leftDiv").style.top)+percent+"px";
    document.getElementById("rightDiv").style.top = parseInt(document.getElementById("leftDiv").style.top)+percent+"px";
    
    lastScrollY=lastScrollY+percent; 
    //alert(lastScrollY);
    }
    
    //下面这段删除后,对联将不跟随屏幕而移动。
    window.setInterval("heartBeat()",1);
    //-->
    </script>
    
    <style type="text/css">
    <!--
    /* 这里定义滴是页面高度,用来测试对联跟随效果滴,跟广告无关 */
    html,body{height:1000px;}
    #mm{height:1000px;}
    
    /* 这里是设置对联样式滴 */
    #leftDiv,#rightDiv{
       width:120px; /* 宽度 */
       height:250px; /* 高度 */
       background-color:#e5e5e5; /* 背景颜色 */
       border:1px solid #ddd; /* 边框样式 */
       position:absolute; /* 绝对定位激活 */
    }
    -->
    </style>
    </head>
    
    <body>
    
    <div id="leftDiv" style="top:120px; /* 距离顶部120px */ left:2px; /* 距离左侧2px */ ">左侧广告内容</div>
    <div id="rightDiv" style="top:120px; /* 距离顶部120px */ right:2px; /* 距离右侧2px */ ">右侧广告内容</div>
    
    <div id="mm">
    </div>
    </body>
    </html>
  • 相关阅读:
    acdream 1017: Fast Transportation 网络流层次图
    centos5的kernel source
    Linux内核源代码的阅读及相关工具介绍(转)
    gcc生成静态库和动态库(转)
    写一篇大家一看就会的教程《JNI初步》(转)
    jni.h
    5分钟学用Lucene
    (VC2005) picture 控件显示16*16的Icon
    (VC/MFC)通过结构体传递参数给线程
    (VC2005)MFC中添加控件的成员变量.
  • 原文地址:https://www.cnblogs.com/blogzys/p/2617713.html
Copyright © 2011-2022 走看看