zoukankan      html  css  js  c++  java
  • js鼠标滑轮侧边广告(仅IE可用)

    <!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=utf-8" />
    <title>鼠标滑轮侧边广告</title>
    </head>

    <body>
    <div style="993;height:1799;text-align:center">
    <img src="images/contentpic.jpg"/>
    </div>

    <div style="top:30px;left:50px;position:absolute;z-index:5; " id="div">
    <img src="images/advpic.jpg" />
    <img src="images/close.jpg" onclick="showclose()" style="margin:0px -15px;position:absolute"/>
    </div>

    </body>

    <script type="text/javascript">

    //获取当前ID
    var divobj = document.getElementById("div");

    //获取长宽
    var objtop = parseInt(divobj.style.top);
    var objleft = parseInt(divobj.style.left);


    //鼠标滚动事件
    function move(){

    var imgtop = document.documentElement.scrollTop;
    var imgleft = document.documentElement.scrollLeft;

    divobj.style.top = parseInt(objtop+imgtop)+"px";
    divobj.style.left = parseInt(objleft+imgleft)+"px";

    }

    onscroll = move;

    //关闭广告
    function showclose(){
    document.getElementById("div").style.display="none";
    }
    </script>
    </html>

    自己整理的可日赚30的软件试玩平台:https://www.cnblogs.com/shiqiboy3974/p/12064466.html

  • 相关阅读:
    iOS-导航条
    iOS-存储
    iOS-模型传递
    iOS-日期相关
    iOS-UIViewController
    iOS-loadView方法
    iOS-UIWindow
    Spring 测试
    Spring条件注解@Conditional
    Spring多线程
  • 原文地址:https://www.cnblogs.com/shiqiboy3974/p/4345426.html
Copyright © 2011-2022 走看看