zoukankan      html  css  js  c++  java
  • 对联广告,带关闭,可以移动

    在网页中加入以下代码 两个图的,一个是关闭用到的,一个是广告图

    <script language=JavaScript src="js/scroll.js"></script> 

    js代码如下:

    suspendcode="<DIV id=lovexin1 style='Z-INDEX: 10; LEFT: 6px; POSITION: absolute; TOP: 105px; 100; height: 300px;'><img src='images/close.gif' onClick='javascript:window.hide()' width='100' height='14' border='0' vspace='3' alt='关闭对联广告'><a href='http://www.makewing.com/lanren/' target='_blank'><img src='images/ad_100x300.jpg' width='100' height='300' border='0'></a></DIV>"
    document.write(suspendcode);

    suspendcode="<DIV id=lovexin2 style='Z-INDEX: 10; LEFT: 896px; POSITION: absolute; TOP: 105px; 100; height: 300px;'><img src='images/close.gif' onClick='javascript:window.hide()' width='100' height='14' border='0' vspace='3' alt='关闭对联广告'><a href='http://www.makewing.com/lanren/' target='_blank'><img src='images/ad_100x300.jpg' width='100' height='300' border='0'></a></DIV>"
    document.write(suspendcode);

    lastScrollY=0;
    function heartBeat(){
    diffY=document.body.scrollTop;
    percent=.3*(diffY-lastScrollY);
    if(percent>0)percent=Math.ceil(percent);
    else percent=Math.floor(percent);
    document.all.lovexin1.style.pixelTop+=percent;
    document.all.lovexin2.style.pixelTop+=percent;
    lastScrollY=lastScrollY+percent;
    }
    function hide() 
    {  
    lovexin1.style.visibility="hidden";
    lovexin2.style.visibility="hidden";
    }
    window.setInterval("heartBeat()",1);

  • 相关阅读:
    Qt之QLineEdit
    Redis与Java
    Qt之属性系统
    Qt之Meta-Object系统
    设计模式(八)外观模式
    Qt之QRadioButton
    Qt之QSystemTrayIcon
    Redis与Java
    JSP公用COMMON文件
    eclipse远程调试Tomcat方法[转]
  • 原文地址:https://www.cnblogs.com/zerogo/p/2209372.html
Copyright © 2011-2022 走看看