简洁型js对联广告代码(点击可关闭的对联广告)

发布时间:2020-04-03编辑:脚本学堂
一例简单的js对联广告代码,与之前脚本学堂提供的对联广告代码相比,这款算是极简单的js对联广告了,有兴趣的朋友参考下。

例子,js对联广告代码。
 

复制代码 代码示例:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<meta http-equiv=content-language content=zh-cn head <>
<script type="text/javascript">
var pophtml = "<div id="popdiv01"><img src="default/rolleyes.gif" width="15" height="15" alt="" /><br /><a href="javascript:hidepopdiv()">关闭</a></div>";
pophtml += "<div id="popdiv02"><img src="/smilies/default/cool.gif" width="15" height="15" alt="" /><br /><a href="javascript:hidepopdiv()">关闭</a></div>";
document.write(pophtml);
var popdiv01 = document.getElementById("popdiv01");
var popdiv02 = document.getElementById("popdiv02");
popdiv01.style.position = "absolute";
popdiv02.style.position = "absolute";
popdiv01.style.left = 0;
popdiv02.style.right = 0;
function intpopx()
{
popdiv01.style.top = document.body.scrollTop + 50;
popdiv02.style.top = document.body.scrollTop + 50;
}
var inp = setInterval("intpopx()",1);
function hidepopdiv()
{
popdiv01.style.display = "none";
popdiv02.style.display = "none";
clearInterval(inp);
}
</script>