亿联网自助建站平台 开启企业建站营销新时代、免费建站平台倡导者  站长学院  高端定制请点这里
热线:13913253836
您现在的位置:首页 > 站长学院 > 建站资讯 > 建站、设计教程 > 对话框和灯箱

网页右下角浮动广告代码

作者:eycms 日期:2016-02-16 17:29:38 人气:54

  

<html>

<script language="Javascript">

<!--

var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer;

function getMsg()

{

divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);

divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);

docWidth = document.body.clientWidth;

docHeight = document.body.clientHeight;

document.getElementById("eMeng").style.top = docHeight + parseInt(document.body.scrollTop,10) + 5;

document.getElementById("eMeng").style.left = docWidth + parseInt(document.body.scrollLeft,10) - divWidth ;

document.getElementById("eMeng").style.visibility="visible";

objTimer = window.setInterval("moveDiv()",10);

}


function resizeDiv()

{

divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);

divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);

docWidth = document.body.clientWidth;

docHeight = document.body.clientHeight;

document.getElementById("eMeng").style.top = docHeight + parseInt(document.body.scrollTop,10) - divHeight ;

document.getElementById("eMeng").style.left = docWidth + parseInt(document.body.scrollLeft,10) - divWidth;

}


function moveDiv()

{

if(parseInt(document.getElementById("eMeng").style.top,10) < (docHeight - divHeight + parseInt(document.body.scrollTop,10)))

{

window.clearInterval(objTimer);

return;

}

divTop = parseInt(document.getElementById("eMeng").style.top,10);

document.getElementById("eMeng").style.top = divTop - 2;

}

function closeDiv()

{

document.getElementById('eMeng').style.visibility="hidden";

if(objTimer) window.clearInterval(objTimer);

}

window.onload = getMsg;

window.onresize = resizeDiv;

window.onscroll = resizeDiv;

-->

</script>

<body>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<div id="eMeng" style="border:1px solid #7788CC;visibility:hidden;position:absolute;top:0px;left:0px;height:150px;width:260px;">

  <div style="background-color:#7788FF;width:260px;height:20px;">

    <div style="cursor:hand;font-size:12px;font-weight:bold;text-align:right;" onClick="closeDiv()">关闭</div>

  </div>

  <div style="border:3px solid #BBCCFF;background-color:#D5E7FD;width:260px;height:130px;">

  <center>

    <span>HelloWorld</span>

  </center>

  </div>

</div>


</body>

</html>


回到顶部