JS右下角悬浮广告代码

<!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>

你可能感兴趣的:(JavaScript,html,function,XHTML)