JS右下角悬浮广告代码

来源:互联网 发布:linux如何设置ip 编辑:程序博客网 时间:2024/05/16 14:34

<!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>
<title>JS右下角悬浮广告代码</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
</head>
<body>
<div style="position:absolute;border:1px solid #000;right:0;" id="ad">内容在这里</div>
<script language="JavaScript" type="text/javascript">
function rightBottomAd(){
 var abc = document.getElementById("ad");
 abc.style.top = document.documentElement.scrollTop+document.documentElement.clientHeight-20+"px";
 setTimeout(function(){rightBottomAd();},50);
}
rightBottomAd();
</script>
<table><tr><td height="1220"></tr></tr></table>
</body>
</html>

原创粉丝点击