• 浮动广告代码


    右下角漂浮代码
    <SCRIPT FOR=window EVENT=onload LANGUAGE="javascript">
    initAd();//载入页面后,调用函数initAd()
    </SCRIPT>
    <script language="javascript">
    <!--
    function initAd() {
    document.all.AdLayer.style.posTop = -200;
    //设置onLoad事件激发以后,广告层相对于固定后的y方向位置
    document.all.AdLayer.style.visibility = 'visible'//设置层为可见
    MoveLayer('AdLayer');//调用函数MoveLayer()
    }
    function MoveLayer(layerName) {
    var x = 0;//浮动广告层固定于浏览器的x方向位置
    var y = 300;//浮动广告层固定于浏览器的y方向位置
    var diff = (document.body.scrollTop + y - document.all.AdLayer.style.posTop)*.40;
    var y = document.body.scrollTop + y - diff;
    eval("document.all." + layerName + ".style.posTop = y");
    eval("document.all." + layerName + ".style.posright = x");//移动广告层
    setTimeout("MoveLayer('AdLayer');", 0);//设置20毫秒后再调用函数MoveLayer()
    }
    //-->
    </script>
    <!--下面为一个ID为AdLayer的层(如ID名不为AdLayer,
    上面MoveLayer()内的AdLayer也要作相应修改),包括一张带链接的图片-->
    <div id=AdLayer style='position:absolute; 200px; height:59px; z-index:20; visibility:hidden;; right: 10px; top: 100px'>
    <b>本人文学网站开通,欢迎大家赏脸光顾</b><br/>
    <a href="http://story.518east.com/Book/Detail/2009/09/01/24152.html" target="_blank">
    <img src="http://story.518east.com/images/logo.jpg" border="0">
    </a></div>




    漂浮广告代码

    <div id="www_qpsh_com" style="position:absolute">
    <b>本人文学网站开通,欢迎大家赏脸光顾</b>
    <a href="http://story.518east.com/Book/Detail/2009/09/01/24152.html" target="_blank">
    <img src="http://img03.518east.com/Story/2009911621301984.jpg" border="0">
    </a>
    </div>
    <script>
    var x = 50,y = 60
    var xin = true, yin = true
    var step = 1
    var delay = 10
    var obj=document.getElementById("www_qpsh_com")
    function floatwww_qpsh_com() {
    var L=T=0
    //by www.qpsh.com
    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("floatwww_qpsh_com()", delay)
    obj.onmouseover=function(){clearInterval(itl)}
    obj.onmouseout=function(){itl=setInterval("floatwww_qpsh_com()", delay)}
    </script>

  • 相关阅读:
    effective c++ 笔记 (30-31)
    设计模式 笔记 装饰模式 Decorator
    设计模式 笔记 组合模式 Composite
    设计模式 笔记 外观模式 Facade
    effective c++ 笔记 (26-29)
    设计模式 笔记 桥接模式 Bridge
    设计模式 笔记 适配器模式 Adapter
    算法导论 第二章作业
    设计模式 创建型模式实践
    设计模式 笔记 单例模式 Singleton
  • 原文地址:https://www.cnblogs.com/cxd4321/p/1563263.html
Copyright © 2020-2023  润新知