弹出窗口自动关闭


点击(此处)折叠或打开

  1. <style type=\"text/css\">
  2. <!--
  3. #sponsorAdDiv {position:absolute; height:1; width:1; top:0; left:0;}
  4. --&gt
  5. </style>
  6. <SCRIPT LANGUAGE=\"JavaScript1.2\">
  7. adTime=6; //关闭窗口等待的时间
  8. chanceAd=1;
  9. var ns=(document.layers);
  10. var ie=(document.all);
  11. var w3=(document.getElementById && !ie);
  12. adCount=0;
  13. function initAd(){
  14. if(!ns && !ie && !w3) return;
  15. if(ie) adDiv=eval(\'document.all.sponsorAdDiv.style\');
  16. else if(ns) adDiv=eval(\'document.layers[\"sponsorAdDiv\"]\');
  17. else if(w3) adDiv=eval(\'document.getElementById(\"sponsorAdDiv\").style\');
  18. randAd=Math.ceil(Math.random()*chanceAd);
  19. if (ie||w3)
  20. adDiv.visibility=\"visible\";
  21. else
  22. adDiv.visibility =\"show\";
  23. if(randAd==1) showAd();
  24. }
  25. function showAd(){
  26. if(adCount<adTime*10){adCount+=1;
  27. if (ie){documentWidth =document.body.offsetWidth/2+document.body.scrollLeft-20;
  28. documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}
  29. else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
  30. documentHeight=window.innerHeight/2+window.pageYOffset-20;}
  31. else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
  32. documentHeight=self.innerHeight/2+window.pageYOffset-20;}
  33. adDiv.left=documentWidth-200;adDiv.top =documentHeight-200;
  34. setTimeout(\"showAd()\",100);}else closeAd();
  35. }
  36. function closeAd(){
  37. if (ie||w3)
  38. adDiv.display=\"none\";
  39. else
  40. adDiv.visibility =\"hide\";
  41. }
  42. onload=initAd;
  43. </script>
  44. <div id=\"sponsorAdDiv\" style=\"visibility:hidden\">
  45. <table width=\"450\" height=\"350\" bgcolor=\"008000\"><tr><td>
  46. <table width=\"445\" height=\"345\" bgcolor=\"F0FFF0\"><tr><td>
  47. <center>欢迎来到www.zcgy211.com,将于5秒后自动关闭,石家庄播音主持</center>
  48. </td></tr></table></td></tr></table></div>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29737856/viewspace-1311597/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29737856/viewspace-1311597/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值