Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

页面过渡广告 Stolen For dz: by lu5266

[复制链接]
lu5266 发表于 2005-10-26 11:41:34 | 显示全部楼层 |阅读模式
名称:  页面过渡广告

For dz:  by lu5266

版本: 所有dz版本

文件:  (include/common.js)

演示: www.5466.ik8.com



方法一:  (简单,修改一步就可以了,特别适合风格多的)

在include/common.js
的末尾加上:

  1. function Adv(){
  2. var nowTime = new Date();
  3. var BasePath = IsRoot ? "" : "../";
  4. bust = Math.floor(1000000*Math.random());
  5. if(arguments.length>2){
  6. sImg=arguments[3];
  7. if (document.all)document.write("<div id=waiting style=position:absolute;top:0px;left:0px;z-index:1;visibility:hidden>");
  8. else document.write("<layer name=waiting top=0 left=0 visibility=hide zIndex=2>");
  9. document.write("<table border=1 cellspacing=1 cellpadding=0 bordercolorlight=#FFFFFF bordercolordark=#C0C0C0 bgcolor=#E0E0E0><tr><td bgcolor=#E0E0E0>"+sImg+"</td></tr><tr><td bgcolor=#E0E0E0>");
  10. if(document.all)document.write("<img src=images/space.gif width=1 height=10 name=sbar style=background-color:#6699cc></td></tr></table></div>");
  11. else {
  12. document.write("<img src=images/space.gif width=1 height=10></td></tr></table></layer>");
  13. document.write("<layer name=rating top=0 left=0 visiblity=hide zIndex=1 bgcolor=#6699CC height=10></layer>");
  14. }
  15. window.onerror = null;
  16. bwidth = 0;
  17. if (document.all) swidth = document.all.waiting.clientWidth;
  18. else swidth = document.waiting.clip.width;
  19. if (arguments[0].search("http://")==0){
  20. if(document.all) document.write("<IFRAME STYLE="z-index:1" WIDTH=250 HEIGHT=80 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no SRC="+arguments[0]+"&number="+nowTime.getTime()+bust+"><\/IFRAME>");
  21. else document.write("<SC"+"RIPT LANGUAGE=JavaScript SRC="+arguments[1]+"&number="+nowTime.getTime()+bust+"></SC"+"RIPT></td>");}
  22. else document.write(arguments[0]);
  23. if (arguments.length>4){
  24. }
  25. }
  26. else{
  27. if(document.all)document.onclick = CheckClick;
  28. else{
  29. window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
  30. window.onmousedown = CheckClick;}
  31. }
  32. eval(AutoRegStr);
  33. }

  34. function CheckClick(e){
  35. if (e == 1){
  36. if (bwidth<swidth*0.98){
  37. bwidth += (swidth - bwidth) * 0.025;
  38. if (document.all)document.sbar.width = bwidth;
  39. else document.rating.clip.width = bwidth;
  40. setTimeout('CheckClick(1);',150);}
  41. }
  42. else{
  43. if(document.all){
  44. if(document.all.waiting.style.visibility == 'visible')
  45. {document.all.waiting.style.visibility = 'hidden';
  46. bwidth = 1;}
  47. whichIt = event.srcElement;
  48. while (whichIt.tagName != "A") {
  49. whichIt = whichIt.parentElement;
  50. if (whichIt == null)return true;
  51. }
  52. if(whichIt.href.substring(0,5)=="http:"){
  53. document.all.waiting.style.pixelTop = (document.body.offsetHeight - document.all.waiting.clientHeight) / 2 + document.body.scrollTop;
  54. document.all.waiting.style.pixelLeft = (document.body.offsetWidth - document.all.waiting.clientWidth) / 2 + document.body.scrollLeft;
  55. document.all.waiting.style.visibility = 'visible';
  56. if(!bwidth)CheckClick(1);
  57. bwidth = 1;}
  58. }
  59. else{
  60. if(document.waiting.visibility == 'show')
  61. {document.waiting.visibility = 'hide';
  62. document.rating.visibility = 'hide';
  63. bwidth = 1;}
  64. if(e.target.href.toString() != ''){
  65. document.waiting.top = (window.innerHeight - document.waiting.clip.height) / 2 + self.pageYOffset;
  66. document.waiting.left = (window.innerWidth - document.waiting.clip.width) / 2 + self.pageXOffset;
  67. document.waiting.visibility = 'show';
  68. document.rating.top = (window.innerHeight - document.waiting.clip.height) / 2 + self.pageYOffset+document.waiting.clip.height-10;
  69. document.rating.left = (window.innerWidth - document.waiting.clip.width) / 2 + self.pageXOffset;
  70. document.rating.visibility = 'show';
  71. if(!bwidth)CheckClick(1);
  72. bwidth = 1;
  73. }}
  74. return true;
  75. }}
  76. var AutoRegStr="";
  77. var IsRoot = false;


  78. //页面过渡广告

  79. //随机图片代码,其中10是图片数量及文件名,如1、2……10.gif,pic/是图片目录,可自行修改
  80. //var myadvpic = Math.floor(Math.random() * 10)+1;
  81. //Adv("","","","<img src=pic/" + myadvpic + ".gif alt=搜集精彩 border=0>","搜集精彩 -- 提示信息");

  82. //单个图片代码
  83. Adv("","","","<a target='_blank' href='http://www.5466.ik8.com'><img src=http://bbs.birdsz.com/UploadFile/2005-3/20053282256399.jpg alt=搜集精彩 border=0></a>","搜集精彩 -- 欢迎你");
  84. Adv("","");
复制代码



方法二:  (麻烦一点点,修改多一步就可以了,特别适合风格少的,但是需要每个风格独立的)

1:

把下面的代码保存为:  showadv.js

  1. function Adv(){
  2. var nowTime = new Date();
  3. var BasePath = IsRoot ? "" : "../";
  4. bust = Math.floor(1000000*Math.random());
  5. if(arguments.length>2){
  6. sImg=arguments[3];
  7. if (document.all)document.write("<div id=waiting style=position:absolute;top:0px;left:0px;z-index:1;visibility:hidden>");
  8. else document.write("<layer name=waiting top=0 left=0 visibility=hide zIndex=2>");
  9. document.write("<table border=1 cellspacing=1 cellpadding=0 bordercolorlight=#FFFFFF bordercolordark=#C0C0C0 bgcolor=#E0E0E0><tr><td bgcolor=#E0E0E0>"+sImg+"</td></tr><tr><td bgcolor=#E0E0E0>");
  10. if(document.all)document.write("<img src=images/space.gif width=1 height=10 name=sbar style=background-color:#6699cc></td></tr></table></div>");
  11. else {
  12. document.write("<img src=images/space.gif width=1 height=10></td></tr></table></layer>");
  13. document.write("<layer name=rating top=0 left=0 visiblity=hide zIndex=1 bgcolor=#6699CC height=10></layer>");
  14. }
  15. window.onerror = null;
  16. bwidth = 0;
  17. if (document.all) swidth = document.all.waiting.clientWidth;
  18. else swidth = document.waiting.clip.width;
  19. if (arguments[0].search("http://")==0){
  20. if(document.all) document.write("<IFRAME STYLE="z-index:1" WIDTH=250 HEIGHT=80 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no SRC="+arguments[0]+"&number="+nowTime.getTime()+bust+"><\/IFRAME>");
  21. else document.write("<SC"+"RIPT LANGUAGE=JavaScript SRC="+arguments[1]+"&number="+nowTime.getTime()+bust+"></SC"+"RIPT></td>");}
  22. else document.write(arguments[0]);
  23. if (arguments.length>4){
  24. }
  25. }
  26. else{
  27. if(document.all)document.onclick = CheckClick;
  28. else{
  29. window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
  30. window.onmousedown = CheckClick;}
  31. }
  32. eval(AutoRegStr);
  33. }

  34. function CheckClick(e){
  35. if (e == 1){
  36. if (bwidth<swidth*0.98){
  37. bwidth += (swidth - bwidth) * 0.025;
  38. if (document.all)document.sbar.width = bwidth;
  39. else document.rating.clip.width = bwidth;
  40. setTimeout('CheckClick(1);',150);}
  41. }
  42. else{
  43. if(document.all){
  44. if(document.all.waiting.style.visibility == 'visible')
  45. {document.all.waiting.style.visibility = 'hidden';
  46. bwidth = 1;}
  47. whichIt = event.srcElement;
  48. while (whichIt.tagName != "A") {
  49. whichIt = whichIt.parentElement;
  50. if (whichIt == null)return true;
  51. }
  52. if(whichIt.href.substring(0,5)=="http:"){
  53. document.all.waiting.style.pixelTop = (document.body.offsetHeight - document.all.waiting.clientHeight) / 2 + document.body.scrollTop;
  54. document.all.waiting.style.pixelLeft = (document.body.offsetWidth - document.all.waiting.clientWidth) / 2 + document.body.scrollLeft;
  55. document.all.waiting.style.visibility = 'visible';
  56. if(!bwidth)CheckClick(1);
  57. bwidth = 1;}
  58. }
  59. else{
  60. if(document.waiting.visibility == 'show')
  61. {document.waiting.visibility = 'hide';
  62. document.rating.visibility = 'hide';
  63. bwidth = 1;}
  64. if(e.target.href.toString() != ''){
  65. document.waiting.top = (window.innerHeight - document.waiting.clip.height) / 2 + self.pageYOffset;
  66. document.waiting.left = (window.innerWidth - document.waiting.clip.width) / 2 + self.pageXOffset;
  67. document.waiting.visibility = 'show';
  68. document.rating.top = (window.innerHeight - document.waiting.clip.height) / 2 + self.pageYOffset+document.waiting.clip.height-10;
  69. document.rating.left = (window.innerWidth - document.waiting.clip.width) / 2 + self.pageXOffset;
  70. document.rating.visibility = 'show';
  71. if(!bwidth)CheckClick(1);
  72. bwidth = 1;
  73. }}
  74. return true;
  75. }}
  76. var AutoRegStr="";
  77. var IsRoot = false;


  78. //页面变化时的动态图片

  79. //随机图片代码,其中10是图片数量及文件名,如1、2……10.gif,pic/是图片目录,可自行修改
  80. //var myadvpic = Math.floor(Math.random() * 10)+1;
  81. //Adv("","","","<img src=pic/" + myadvpic + ".gif alt=搜集精彩 border=0>","搜集精彩 -- 提示信息");

  82. //单个图片代码
  83. Adv("","","","<a target='_blank' href='http://www.5466.ik8.com'><img src=http://bbs.birdsz.com/UploadFile/2005-3/20053282256399.jpg alt=搜集精彩 border=0></a>","搜集精彩 -- 欢迎你");
  84. Adv("","");
复制代码


2: 在header.htm里查找:

  1. <script language="JavaScript" src="include/common.js"></script>
复制代码


在下面加上:

<script language="JavaScript" src="include/showadv.js"></script>


ok

3:回来支持下



说明:

  1. //页面变化时的动态图片

  2. //随机图片代码,其中10是图片数量及文件名,如1、2……10.gif,pic/是图片目录,可自行修改
  3. //var myadvpic = Math.floor(Math.random() * 10)+1;
  4. //Adv("","","","<img src=pic/" + myadvpic + ".gif alt=搜集精彩 border=0>","搜集精彩 -- 提示信息");

  5. //单个图片代码
  6. Adv("","","","<a target='_blank' href='http://www.5466.ik8.com'><img src=http://bbs.birdsz.com/UploadFile/2005-3/20053282256399.jpg alt=搜集精彩 border=0></a>","搜集精彩 -- 欢迎你");
  7. Adv("","");
复制代码


这些就是广告代码

自己设置了

[ 本帖最后由 lu5266 于 2005-10-27 14:51 编辑 ]

评分

1

查看全部评分

 楼主| lu5266 发表于 2005-10-26 11:41:51 | 显示全部楼层
占了哦
哈哈

[ 本帖最后由 lu5266 于 2005-10-27 14:52 编辑 ]
回复

使用道具 举报

freddy 发表于 2005-10-26 11:47:36 | 显示全部楼层
我晕!LULU不会吧?!
回复

使用道具 举报

freddy 发表于 2005-10-26 11:47:57 | 显示全部楼层
过滤广告是什么意思?
回复

使用道具 举报

 楼主| lu5266 发表于 2005-10-26 11:51:47 | 显示全部楼层
原帖由 freddy 于 2005-10-26 11:47 发表
我晕!LULU不会吧?!

哈哈
回复

使用道具 举报

 楼主| lu5266 发表于 2005-10-26 11:52:13 | 显示全部楼层
原帖由 freddy 于 2005-10-26 11:47 发表
过滤广告是什么意思?

是过渡

而不是过滤
回复

使用道具 举报

 楼主| lu5266 发表于 2005-10-26 11:54:38 | 显示全部楼层
原帖由 freddy 于 2005-10-26 11:47 发表
过滤广告是什么意思?

https://discuz.dismall.com/viewth ... page%3D2&page=1
回复

使用道具 举报

伤心♂oO○ 发表于 2005-10-26 11:57:41 | 显示全部楼层
呵呵...谢谢达人呀!!!真好人!!感谢中!激动的哭了!............
回复

使用道具 举报

 楼主| lu5266 发表于 2005-10-26 11:59:42 | 显示全部楼层
原帖由 伤心♂oO○ 于 2005-10-26 11:57 发表
呵呵...谢谢达人呀!!!真好人!!感谢中!激动的哭了!............


只要你不伤心♂oO○
就可以了
回复

使用道具 举报

karl907 发表于 2005-10-26 12:02:17 | 显示全部楼层
厲害啊1!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-23 17:54 , Processed in 0.029966 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表