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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[补丁] 贴间挂件的js的优化

[复制链接]
lu5266 发表于 2005-11-11 20:26:06 | 显示全部楼层 |阅读模式
应人要求: 改为单击可以隐藏,顺便优化下,给大家分享下

感谢M55兄弟提供了98个精美的挂饰
[ https://discuz.dismall.com/viewth ... page%3D1&page=3 ]
30楼



原贴: https://discuz.dismall.com/viewthread.php?tid=188488


优化方法:

把include/ad.js
里面的代码用下面的代替:



  1. //-- 增加图片后,把 a = 136 后面的数字改成相应条数即可。
  2. //-- 你也可以把" alt=看啥?这是本站给的回帖鼓励,加油哦!"这句话去掉
  3. a = 136
  4. var talet = Math.round(Math.random() * (a-1))+1;
  5. function create() { this.under = '' }
  6. b = new Array()
  7. for(var i=1; i<=a; i++) { b[i] = new create()  
  8. b[i].under = '<img src=images/guajian/'+i+'.gif alt=这是给回帖的鼓励,单击隐藏! onclick=this.style.visibility="hidden" >'
  9. }
  10. document.write(b[talet].under);
复制代码


优化完毕.



附上:
//==================原贴的ad.js的代码===================


  1. //-- 增加图片后,把 a = 136 后面的数字改成相应条数即可。
  2. //-- 你也可以把"title=看啥?这是本站给的回帖鼓励,加油哦!"这句话去掉
  3. <!--end Java-->
  4. <!--
  5. a = 136
  6. var slump = Math.random();
  7. var talet = Math.round(slump * (a-1))+1;
  8. function create() {
  9. this.under = ''
  10. }
  11. b = new Array()
  12. for(var i=1; i<=a; i++) { b[i] = new create() }
  13. b[1].under = '<img src=images/guajian/1.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  14. b[2].under = '<img src=images/guajian/2.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  15. b[3].under = '<img src=images/guajian/3.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  16. b[4].under = '<img src=images/guajian/4.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  17. b[5].under = '<img src=images/guajian/5.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  18. b[6].under = '<img src=images/guajian/6.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  19. b[7].under = '<img src=images/guajian/7.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  20. b[8].under = '<img src=images/guajian/8.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  21. b[9].under = '<img src=images/guajian/9.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  22. b[10].under = '<img src=images/guajian/10.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  23. b[11].under = '<img src=images/guajian/11.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  24. b[12].under = '<img src=images/guajian/12.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  25. b[13].under = '<img src=images/guajian/13.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  26. b[14].under = '<img src=images/guajian/14.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  27. b[15].under = '<img src=images/guajian/15.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  28. b[16].under = '<img src=images/guajian/16.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  29. b[17].under = '<img src=images/guajian/17.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  30. b[18].under = '<img src=images/guajian/18.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  31. b[19].under = '<img src=images/guajian/19.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  32. b[20].under = '<img src=images/guajian/20.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  33. b[21].under = '<img src=images/guajian/21.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  34. b[22].under = '<img src=images/guajian/22.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  35. b[23].under = '<img src=images/guajian/23.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  36. b[24].under = '<img src=images/guajian/24.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  37. b[25].under = '<img src=images/guajian/25.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  38. b[26].under = '<img src=images/guajian/26.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  39. b[27].under = '<img src=images/guajian/27.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  40. b[28].under = '<img src=images/guajian/28.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  41. b[29].under = '<img src=images/guajian/29.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  42. b[30].under = '<img src=images/guajian/30.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  43. b[31].under = '<img src=images/guajian/31.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  44. b[32].under = '<img src=images/guajian/32.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  45. b[33].under = '<img src=images/guajian/33.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  46. b[34].under = '<img src=images/guajian/34.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  47. b[35].under = '<img src=images/guajian/35.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  48. b[36].under = '<img src=images/guajian/36.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  49. b[37].under = '<img src=images/guajian/37.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  50. b[38].under = '<img src=images/guajian/38.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  51. b[39].under = '<img src=images/guajian/39.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  52. b[40].under = '<img src=images/guajian/40.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  53. b[41].under = '<img src=images/guajian/41.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  54. b[42].under = '<img src=images/guajian/42.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  55. b[43].under = '<img src=images/guajian/43.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  56. b[44].under = '<img src=images/guajian/44.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  57. b[45].under = '<img src=images/guajian/45.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  58. b[46].under = '<img src=images/guajian/46.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  59. b[47].under = '<img src=images/guajian/47.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  60. b[48].under = '<img src=images/guajian/48.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  61. b[49].under = '<img src=images/guajian/49.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  62. b[50].under = '<img src=images/guajian/50.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  63. b[51].under = '<img src=images/guajian/51.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  64. b[52].under = '<img src=images/guajian/52.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  65. b[53].under = '<img src=images/guajian/53.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  66. b[54].under = '<img src=images/guajian/54.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  67. b[55].under = '<img src=images/guajian/55.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  68. b[56].under = '<img src=images/guajian/56.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  69. b[57].under = '<img src=images/guajian/57.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  70. b[58].under = '<img src=images/guajian/58.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  71. b[59].under = '<img src=images/guajian/59.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  72. b[60].under = '<img src=images/guajian/60.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  73. b[61].under = '<img src=images/guajian/61.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  74. b[62].under = '<img src=images/guajian/62.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  75. b[63].under = '<img src=images/guajian/63.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  76. b[64].under = '<img src=images/guajian/64.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  77. b[65].under = '<img src=images/guajian/65.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  78. b[66].under = '<img src=images/guajian/66.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  79. b[67].under = '<img src=images/guajian/67.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  80. b[68].under = '<img src=images/guajian/68.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  81. b[69].under = '<img src=images/guajian/69.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  82. b[70].under = '<img src=images/guajian/70.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  83. b[71].under = '<img src=images/guajian/71.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  84. b[72].under = '<img src=images/guajian/72.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  85. b[73].under = '<img src=images/guajian/73.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  86. b[74].under = '<img src=images/guajian/74.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  87. b[75].under = '<img src=images/guajian/75.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  88. b[76].under = '<img src=images/guajian/76.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  89. b[77].under = '<img src=images/guajian/77.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  90. b[78].under = '<img src=images/guajian/78.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  91. b[79].under = '<img src=images/guajian/79.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  92. b[80].under = '<img src=images/guajian/80.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  93. b[81].under = '<img src=images/guajian/81.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  94. b[82].under = '<img src=images/guajian/82.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  95. b[83].under = '<img src=images/guajian/83.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  96. b[84].under = '<img src=images/guajian/84.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  97. b[85].under = '<img src=images/guajian/85.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  98. b[86].under = '<img src=images/guajian/86.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  99. b[87].under = '<img src=images/guajian/87.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  100. b[88].under = '<img src=images/guajian/88.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  101. b[89].under = '<img src=images/guajian/89.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  102. b[90].under = '<img src=images/guajian/90.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  103. b[91].under = '<img src=images/guajian/91.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  104. b[92].under = '<img src=images/guajian/92.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  105. b[93].under = '<img src=images/guajian/93.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  106. b[94].under = '<img src=images/guajian/94.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  107. b[95].under = '<img src=images/guajian/95.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  108. b[96].under = '<img src=images/guajian/96.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  109. b[97].under = '<img src=images/guajian/97.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  110. b[98].under = '<img src=images/guajian/98.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  111. b[99].under = '<img src=images/guajian/99.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  112. b[100].under = '<img src=images/guajian/100.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  113. b[101].under = '<img src=images/guajian/101.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  114. b[102].under = '<img src=images/guajian/102.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  115. b[103].under = '<img src=images/guajian/103.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  116. b[104].under = '<img src=images/guajian/104.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  117. b[105].under = '<img src=images/guajian/105.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  118. b[106].under = '<img src=images/guajian/106.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  119. b[107].under = '<img src=images/guajian/107.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  120. b[108].under = '<img src=images/guajian/108.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  121. b[109].under = '<img src=images/guajian/109.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  122. b[110].under = '<img src=images/guajian/110.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  123. b[111].under = '<img src=images/guajian/111.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  124. b[112].under = '<img src=images/guajian/112.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  125. b[113].under = '<img src=images/guajian/113.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  126. b[114].under = '<img src=images/guajian/114.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  127. b[115].under = '<img src=images/guajian/115.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  128. b[116].under = '<img src=images/guajian/116.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  129. b[117].under = '<img src=images/guajian/117.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  130. b[118].under = '<img src=images/guajian/118.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  131. b[119].under = '<img src=images/guajian/119.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  132. b[120].under = '<img src=images/guajian/120.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  133. b[121].under = '<img src=images/guajian/121.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  134. b[122].under = '<img src=images/guajian/122.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  135. b[123].under = '<img src=images/guajian/123.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  136. b[124].under = '<img src=images/guajian/124.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  137. b[125].under = '<img src=images/guajian/125.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  138. b[126].under = '<img src=images/guajian/126.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  139. b[127].under = '<img src=images/guajian/127.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  140. b[128].under = '<img src=images/guajian/128.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  141. b[129].under = '<img src=images/guajian/129.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  142. b[130].under = '<img src=images/guajian/130.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  143. b[131].under = '<img src=images/guajian/131.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  144. b[132].under = '<img src=images/guajian/132.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  145. b[133].under = '<img src=images/guajian/133.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  146. b[134].under = '<img src=images/guajian/134.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  147. b[135].under = '<img src=images/guajian/135.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'
  148. b[136].under = '<img src=images/guajian/136.gif title=看啥?这是本站给的回帖鼓励,加油哦!>'

  149. <!--end Java-->
  150. var visa = "";
  151. document.write(b[talet].under);
  152. //-->
复制代码

[ 本帖最后由 lu5266 于 2005-12-7 18:13 编辑 ]

评分

1

查看全部评分

 楼主| lu5266 发表于 2005-11-11 20:29:45 | 显示全部楼层
https://discuz.dismall.com/viewth ... page%3D1&page=3

有98个挂式


原帖由 跑的快 于 2005-12-4 01:01 发表
请问怎样才能只让它在第一楼显示呢??????????


viewthread.htm

加的那段替换为

  1. <!--{if $post['postcount']==1}-->
  2.         <span style='position:relative'><div id=serve style='position:absolute;right:50px; top:0px; width:10px;height:30px;'><SCRIPT language=javascript src=include/ad.js></SCRIPT></div></span>
  3. <!--{/if}-->
复制代码

[ 本帖最后由 lu5266 于 2005-12-7 18:14 编辑 ]
回复

使用道具 举报

oimmnet 发表于 2005-11-11 20:31:23 | 显示全部楼层
唉,好東西,不過我把它裝了又刪了,,感覺不太好
回复

使用道具 举报

 楼主| lu5266 发表于 2005-11-11 20:33:38 | 显示全部楼层
原帖由 oimmnet 于 2005-11-11 20:31 发表
唉,好東西,不過我把它裝了又刪了,,感覺不太好


我把它只在第一楼显示而已

感觉还是很可以的
回复

使用道具 举报

oimmnet 发表于 2005-11-11 20:58:16 | 显示全部楼层
呵呵,相對於動漫娛樂版塊來說應該還行。。。
回复

使用道具 举报

 楼主| lu5266 发表于 2005-11-11 21:12:09 | 显示全部楼层
原帖由 oimmnet 于 2005-11-11 20:58 发表
呵呵,相對於動漫娛樂版塊來說應該還行。。。



呵呵
回复

使用道具 举报

winter0706 发表于 2005-11-11 21:23:22 | 显示全部楼层
的確不錯~
lulu真的是JS高手
回复

使用道具 举报

 楼主| lu5266 发表于 2005-11-11 21:47:05 | 显示全部楼层
原帖由 winter0706 于 2005-11-11 21:23 发表
的確不錯~
lulu真的是JS高手


回复

使用道具 举报

 楼主| lu5266 发表于 2005-11-12 09:17:29 | 显示全部楼层
分享.....
回复

使用道具 举报

beecheung 发表于 2005-11-12 10:03:23 | 显示全部楼层
支持你lulu
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-3 12:22 , Processed in 0.123766 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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