• 窗口碰壁弹回的浮动广告代码


    <div id="ad" style="position:absolute">

    <TABLE cellSpacing=0 cellPadding=0 style='border-left:1px solid #333333;border-top:1px solid #333333;border-right:1px solid #333333;font-size:12px;color:#ffffff'>
    <TR bgcolor=#2E6287>
     <TD height=20>
     </TD>
     <TD style="CURSOR: hand;text-align:right" onclick="ad.style.visibility='hidden'">关 闭
     </TD>
    </TR>
    <TR>
    <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/lf.gif"
     OnClick="ImageButton1_Click" /></TR>
     </TABLE>
    </div>
    <script>
    var x = 50,y = 60
    var xin = true, yin = true
    var step = 1
    var delay = 10
    var obj=document.getElementById("ad")
    function floatAD() {
    var L=T=0
    var R= document.body.clientWidth-obj.offsetWidth
    var B = document.body.clientHeight-obj.offsetHeight
    obj.style.left = x + document.body.scrollLeft
    obj.style.top = y + document.body.scrollTop
    x = x + step*(xin?1:-1)
    if (x < L) { xin = true; x = L}
    if (x > R){ xin = false; x = R}
    y = y + step*(yin?1:-1)
    if (y < T) { yin = true; y = T }
    if (y > B) { yin = false; y = B }
    }
    var itl= setInterval("floatAD()", delay)
    obj.onmouseover=function(){clearInterval(itl)}
    obj.onmouseout=function(){itl=setInterval("floatAD()", delay)}
    </script>

  • 相关阅读:
    CacheHelper
    自动完成 或者动态匹配
    http://www.jb51.net/article/28619.htm
    http://www.kindsoft.net/docs/qna.html
    开发测试的理想模型
    关于浮点数的死区问题
    ZOJ Problem Set – 2321 Filling Out the Team
    Input类、四元数、
    忙蒙蔽了
    2014-03-28
  • 原文地址:https://www.cnblogs.com/windphoenix/p/1310797.html
Copyright © 2020-2023  润新知