• 右下角浮动广告代码


    右下角浮动广告代码

    原代码:

    <!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>右下角广告代码-web前端开发</title>
    <script type="text/javascript">
    window.onload = getMsg;
    window.onresize = resizeDiv;
    window.onerror = function(){}
    function $(id) {return document.getElementById(id);}
    //短信提示使用(asilas添加)
    var divT,divL,divW,divH,docH,docW,docST,docSL,objTimer,i = 0;
    function getMsg()
    {
    try{
    divT = parseInt($("eMeng").style.top,10); //层top位置
    divL = parseInt($("eMeng").style.left,10); //层left位置
    divH = parseInt($("eMeng").offsetHeight,10);//层宽
    divW = parseInt($("eMeng").offsetWidth,10);//层高
    docW = document.documentElement.clientWidth;//窗口宽
    docH = document.documentElement.clientHeight;//窗口高
    docST=document.documentElement.scrollTop;
    docSL=document.documentElement.scrollLeft;
    $("eMeng").style.top = parseInt(docST,10) + docH + 10+"px";
    $("eMeng").style.left = parseInt(docSL,10) + docW - divW+"px";
    $("eMeng").style.visibility="visible";
    objTimer = setInterval("moveDiv()",10);
    }
    catch(e){}
    }
    function resizeDiv()
    {
    try{
    divH = parseInt($("eMeng").offsetHeight,10);
    divW = parseInt($("eMeng").offsetWidth,10);
    docW = document.documentElement.clientWidth;
    docH = document.documentElement.clientHeight;
    $("eMeng").style.top = docH - divH + parseInt(document.documentElement.scrollTop,10)+"px";
    $("eMeng").style.left = docW - divW + parseInt(document.documentElement.scrollLeft,10)+"px";
    }
    catch(e){}
    }
    function moveDiv()
    {
    try{
    if(parseInt($("eMeng").style.top,10) <= (docH - divH + parseInt(document.documentElement.scrollTop,10)))
    {
    window.clearInterval(objTimer)
    objTimer = setInterval("resizeDiv()",1)
    }
    divT = parseInt($("eMeng").style.top,10);
    $("eMeng").style.top = divT - 1+"px";
    }
    catch(e){}
    }
    function closeDiv()
    {
    $('eMeng').style.visibility='hidden';
    if(objTimer) window.clearInterval(objTimer)
    }
    </script>
    <div id="eMeng" style="z-index: 99999; visibility:hidden; left: 0px; 252px; position: absolute; top: 0px; height: 213px; background:url(http://image.5fad.com/5/img/ad_bg.gif)">
    <div style=" height:28px">
    <div style=" 20px; height:20px; float:right; margin:5px 5px 0 0; cursor:pointer" onclick="closeDiv()"></div>
    </div>
    <div style="225px; height:164px; margin:0 auto;"><a href="http://5.5fad.com/star/pur_detial.aspx?news=138" target="_blank"><img src="http://image.5fad.com/5/ad/ad01.jpg" width="225" height="164" border="0" /></a></div>
    </div>
    </body>
    </html>

  • 相关阅读:
    Taro api封装
    taro中如何定义全局变量
    移动端悬浮框可移动,可回弹,Vue and React
    VS2015 安装mvc4安装包以及vs2010 sp1后导致Razor语法失效代码不高亮(能正常运行)/视图页面无法智能提示(.cshtml)解决办法
    C#6.0新特性的尝试
    Visual Studio Code 添加设置代码段(snippet)
    AngularJs的$http发送POST请求,php无法接收Post的数据解决方案
    [Asp.net mvc] 在Asp.net mvc 中使用MiniProfiler
    [Asp.net mvc]实体更新异常:存储区更新、插入或删除语句影响到了意外的行数(0)。实体在加载后可能被修改或删除。
    win8.1右键新建菜单添加新建php文件
  • 原文地址:https://www.cnblogs.com/leejersey/p/2284540.html
Copyright © 2020-2023  润新知