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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[原創]第十四貼-小美化—按滑鼠跳出星星來!

[复制链接]
jimmyjimmyqqq 发表于 2005-8-27 15:58:34 | 显示全部楼层 |阅读模式
插件名稱:小美化—按滑鼠跳出星星來!
適用版本:2.5/SP1
最後更新日期:27/8
作      者:jimmyjimmyqqq
修      改:/
程式指導:jimmyjimmyqqq
數據升級:/
修改文件:/
修改模板:header.htm
新增文件:/
新增模板:/
安裝難度:★☆☆☆☆

演   示:

不明白,上
http://www.pcmscs.org/~lovebear/bbs/
在空白地方按一下,就明白了!

+++++++++++++++++++++++++++++++++++
開始安裝
+++++++++++++++++++++++++++++++++++
打開你風格的header.htm
最下加入:
  1. <script>
  2. <!-- Begin
  3. var ver  = navigator.appVersion;
  4. var dom  = document.getElementById ? 1 : 0;
  5. var ie5  = (ver.indexOf("MSIE 5") > -1 && dom) ? 1 : 0;
  6. var n  = (document.layers);
  7. var ie = (document.all);

  8. var sparksAflyin = 0;
  9. var totalSparks = 0;
  10. var sparksOn = 1;
  11. function initStars() {
  12. document.onmousedown = mouseDown;
  13. if (n) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
  14. }
  15. function mouseDown(e) {
  16. if (sparksOn) {
  17. var mousex = (n) ? e.pageX : event.x+document.body.scrollLeft;
  18. var mousey = (n) ? e.pageY : event.y+document.body.scrollTop;
  19. if (!sparksAflyin) {
  20. for (var k = 0; k <= 9; k++)
  21.   eval('SHOW("sDiv'+k+'")');
  22. sparksAflyin = 1;
  23. totalSparks = 0;
  24. for(i = 0;i <= 9; i++)
  25. eval('moveTo('+i+',0,'+mousex+','+mousey+')');
  26.      }
  27.   }
  28. }
  29. function moveTo(i,j, mousex, mousey){
  30. if (j < eval('anim_'+i+'_x.length') ){
  31. var tempx = eval('anim_'+i+'_x[j]+mousex');
  32. var tempy = eval('anim_'+i+'_y[j]+mousey');
  33. if (ie) {
  34. if(tempy+30 > (document.body.offsetHeight+document.body.scrollTop))
  35. tempy = document.body.offsetHeight+document.body.scrollTop-30;
  36. if(tempx+30 > (document.body.offsetWidth+document.body.scrollLeft))
  37. tempx = document.body.offsetWidth+document.body.scrollLeft-30;
  38. eval('document.all.sDiv'+i+'.style.left = tempx;');
  39. eval('document.all.sDiv'+i+'.style.top  = tempy;');
  40. }
  41. if (n) {
  42. eval('document.layers.sDiv'+i+'.left = tempx;');
  43. eval('document.layers.sDiv'+i+'.top  = tempy;');
  44. }
  45. j++;

  46.    setTimeout("moveTo("+i+","+j+","+mousex+","+mousey+")",50)
  47. }
  48. else {
  49. eval('HIDE("sDiv'+i+'")');
  50. totalSparks++;
  51. }
  52. if (totalSparks == 10) {
  53. sparksAflyin = 0;
  54. totalSparks  = 0;
  55.   }
  56. }
  57. function SHOW(divName){
  58. if (document.all)
  59. eval('document.all.'+divName+'.style.visibility = "visible";');
  60. else if (document.layers)
  61. eval('document.layers["'+divName+'"].visibility = "visible";');
  62. }

  63. //設定星星的跳出位置 [須小心設定每顆星的 -axis同 y-axis]

  64. function HIDE(divName){
  65. if (document.all)
  66. eval('document.all.'+divName+'.style.visibility = "hidden";');
  67. else if (document.layers)
  68. eval('document.layers["'+divName+'"].visibility = "hide";');
  69. }
  70. anim_0_x=new Array(20,20,10,0,0,0,0,0,0,0,0,0);
  71. anim_0_y=new Array(-20,-40,-60,-80,-60,-40,-20,0,20,40,60,80);
  72. anim_1_x=new Array(20,20,17,36,60,78,90,92,93,98,108,120,133,152,181);
  73. anim_1_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253);
  74. anim_2_x=new Array(20,20,2,3,4,5,6,7,8,9,10,12,13,15,18);
  75. anim_2_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253);
  76. anim_3_x=new Array(-20,-20,-2,-1,7,10,18,35,60,102,94,94,93,97,108,111,117,127);
  77. anim_3_y=new Array(-20,-25,-64,-89,-104,-150,-173,-197,-213,-199,-151,-101,-66,-17,27,87,140,189);
  78. anim_4_x=new Array(-20,-20,-10,-39,-30,-69,-64,-138,-154,-200,-181,-209,-191,-207,-203,-213,-202,-221,-211);
  79. anim_4_y=new Array(-20,-20,-28,-51,-79,-100,-135,-154,-193,-183,-149,-134,-89,-60,8,51,107,157,201);
  80. anim_5_x=new Array(-20,-29,-51,-72,-105,-133,-164,-189,-209,-229,-247,-270,-279,-282,-283,-283,-285,-286,-288);
  81. anim_5_y=new Array(-20,-55,-86,-116,-154,-183,-205,-217,-217,-198,-169,-120,-44,-8,40,87,144,190,248);
  82. anim_6_x=new Array(-20,-20,-7,14,44,79,143,186,217,226,234,244,250,259,265,274);
  83. anim_6_y=new Array(-20,-21,-72,-113,-139,-166,-188,-181,-126,-68,-3,54,134,187,215,257);
  84. anim_7_x=new Array(20,20,-3,-9,-13,-27,-33,-44,-54,-66,-77,-95,-107,-136,-150,-160,-164,-168,-171,-172,-172,-176,-175);
  85. anim_7_y=new Array(-20,-26,-43,-63,-89,-116,-145,-169,-201,-222,-240,-253,-254,-245,-220,-195,-160,-124,-81,-53,-26,19,68);
  86. anim_8_x=new Array(-20,20,-35,39,0,45,-1,24,-15,14,-20,35,-18,38,-11,16,49,64,81,93,100,103,109);
  87. anim_8_y=new Array(-20,-20,-32,-42,-62,-76,-89,-107,-132,-147,-173,-180,-192,-209,-236,-193,-119,-73,-24,51,95,130,188);
  88. anim_9_x=new Array(-20,-51,-89,-110,-165,-191,-228,-240,-259,-271,-277,-281,-287);
  89. anim_9_y=new Array(-20,-20,-35,-37,-34,-16,10,47,105,150,189,227,273);
  90. //  End -->
  91. </script>
  92. <body onload="initStars()">

  93. <div id="sparks"><div id="sDiv0" style="position:absolute; visibility: hidden;">
  94. <p></font><font color="red">☆ </font></p>
  95. </div><div id="sDiv1" style="position:absolute; visibility: hidden;">

  96. <p></font><font color="yellow">☆ </font></p>
  97. </div><div id="sDiv2" style="position:absolute; visibility: hidden;"><font
  98. face="arial black" color="#3399ff">

  99. <p></font><font color="#3399ff">☆ </font></p>
  100. </div><div id="sDiv3" style="position:absolute; visibility: hidden;"><font
  101. face="arial black" color="#ff6600">

  102. <p></font><font color="#ff6600">☆ </font></p>
  103. </div><div id="sDiv4" style="position:absolute; visibility: hidden;"><font
  104. face="arial black" color="#ff9900">

  105. <p></font><font color="#ff9900">☆ </font></p>
  106. </div><div id="sDiv5" style="position:absolute; visibility: hidden;"><font
  107. face="arial black" color="white">

  108. <p></font><font color="white">☆ </font></p>
  109. </div><div id="sDiv6" style="position:absolute; visibility: hidden;"><font
  110. face="arial black" color="Lime">

  111. <p></font><font color="Lime">☆ </font></p>
  112. </div><div id="sDiv7" style="position:absolute; visibility: hidden;"><font
  113. face="arial black" color="#66ffff">

  114. <p></font><font color="#66ffff">☆ </font></p>
  115. </div><div id="sDiv8" style="position:absolute; visibility: hidden;"><font
  116. face="arial black" color="#ffff99">

  117. <p></font><font color="#ffff99">☆ </font></p>
  118. </div><div id="sDiv9" style="position:absolute; visibility: hidden;"><font
  119. face="arial black" color="#ff66ff">

  120. <p></font><font color="#ff66ff">☆ </font></p>
  121. </div>
复制代码

完成,謝謝支持!

评分

1

查看全部评分

veblen 发表于 2005-8-27 16:04:39 | 显示全部楼层
测试可以..多谢!!
回复

使用道具 举报

 楼主| jimmyjimmyqqq 发表于 2005-8-27 16:06:05 | 显示全部楼层
原帖由 veblen 于 2005-8-27 16:04 发表
测试可以..多谢!!

謝謝支持!
回复

使用道具 举报

ngkwunlun990 发表于 2005-8-27 16:14:25 | 显示全部楼层
這個好似PW一個插件!只是好似~~~~
回复

使用道具 举报

默契网管 发表于 2005-8-27 16:17:57 | 显示全部楼层
可以设置成,.,,   点鼠标左键   就出现吗?

但是  只能点空白处才有效果,.

点连接没效果的
回复

使用道具 举报

ngkwunlun990 发表于 2005-8-27 16:21:47 | 显示全部楼层
你的演示!表示安裝後會很LAG~~~=_=
回复

使用道具 举报

默契网管 发表于 2005-8-27 16:26:14 | 显示全部楼层

正确的修改方法应该是?

打开 header.htm

查找  

  1. <head>
复制代码


在下面加入

  1. <script>
  2. <!-- Begin
  3. var ver  = navigator.appVersion;
  4. var dom  = document.getElementById ? 1 : 0;
  5. var ie5  = (ver.indexOf("MSIE 5") > -1 && dom) ? 1 : 0;
  6. var n  = (document.layers);
  7. var ie = (document.all);

  8. var sparksAflyin = 0;
  9. var totalSparks = 0;
  10. var sparksOn = 1;
  11. function initStars() {
  12. document.onmousedown = mouseDown;
  13. if (n) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
  14. }
  15. function mouseDown(e) {
  16. if (sparksOn) {
  17. var mousex = (n) ? e.pageX : event.x+document.body.scrollLeft;
  18. var mousey = (n) ? e.pageY : event.y+document.body.scrollTop;
  19. if (!sparksAflyin) {
  20. for (var k = 0; k <= 9; k++)
  21.   eval('SHOW("sDiv'+k+'")');
  22. sparksAflyin = 1;
  23. totalSparks = 0;
  24. for(i = 0;i <= 9; i++)
  25. eval('moveTo('+i+',0,'+mousex+','+mousey+')');
  26.      }
  27.   }
  28. }
  29. function moveTo(i,j, mousex, mousey){
  30. if (j < eval('anim_'+i+'_x.length') ){
  31. var tempx = eval('anim_'+i+'_x[j]+mousex');
  32. var tempy = eval('anim_'+i+'_y[j]+mousey');
  33. if (ie) {
  34. if(tempy+30 > (document.body.offsetHeight+document.body.scrollTop))
  35. tempy = document.body.offsetHeight+document.body.scrollTop-30;
  36. if(tempx+30 > (document.body.offsetWidth+document.body.scrollLeft))
  37. tempx = document.body.offsetWidth+document.body.scrollLeft-30;
  38. eval('document.all.sDiv'+i+'.style.left = tempx;');
  39. eval('document.all.sDiv'+i+'.style.top  = tempy;');
  40. }
  41. if (n) {
  42. eval('document.layers.sDiv'+i+'.left = tempx;');
  43. eval('document.layers.sDiv'+i+'.top  = tempy;');
  44. }
  45. j++;

  46.    setTimeout("moveTo("+i+","+j+","+mousex+","+mousey+")",50)
  47. }
  48. else {
  49. eval('HIDE("sDiv'+i+'")');
  50. totalSparks++;
  51. }
  52. if (totalSparks == 10) {
  53. sparksAflyin = 0;
  54. totalSparks  = 0;
  55.   }
  56. }
  57. function SHOW(divName){
  58. if (document.all)
  59. eval('document.all.'+divName+'.style.visibility = "visible";');
  60. else if (document.layers)
  61. eval('document.layers["'+divName+'"].visibility = "visible";');
  62. }

  63. //設定星星的跳出位置 [須小心設定每顆星的 -axis同 y-axis]

  64. function HIDE(divName){
  65. if (document.all)
  66. eval('document.all.'+divName+'.style.visibility = "hidden";');
  67. else if (document.layers)
  68. eval('document.layers["'+divName+'"].visibility = "hide";');
  69. }
  70. anim_0_x=new Array(20,20,10,0,0,0,0,0,0,0,0,0);
  71. anim_0_y=new Array(-20,-40,-60,-80,-60,-40,-20,0,20,40,60,80);
  72. anim_1_x=new Array(20,20,17,36,60,78,90,92,93,98,108,120,133,152,181);
  73. anim_1_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253);
  74. anim_2_x=new Array(20,20,2,3,4,5,6,7,8,9,10,12,13,15,18);
  75. anim_2_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253);
  76. anim_3_x=new Array(-20,-20,-2,-1,7,10,18,35,60,102,94,94,93,97,108,111,117,127);
  77. anim_3_y=new Array(-20,-25,-64,-89,-104,-150,-173,-197,-213,-199,-151,-101,-66,-17,27,87,140,189);
  78. anim_4_x=new Array(-20,-20,-10,-39,-30,-69,-64,-138,-154,-200,-181,-209,-191,-207,-203,-213,-202,-221,-211);
  79. anim_4_y=new Array(-20,-20,-28,-51,-79,-100,-135,-154,-193,-183,-149,-134,-89,-60,8,51,107,157,201);
  80. anim_5_x=new Array(-20,-29,-51,-72,-105,-133,-164,-189,-209,-229,-247,-270,-279,-282,-283,-283,-285,-286,-288);
  81. anim_5_y=new Array(-20,-55,-86,-116,-154,-183,-205,-217,-217,-198,-169,-120,-44,-8,40,87,144,190,248);
  82. anim_6_x=new Array(-20,-20,-7,14,44,79,143,186,217,226,234,244,250,259,265,274);
  83. anim_6_y=new Array(-20,-21,-72,-113,-139,-166,-188,-181,-126,-68,-3,54,134,187,215,257);
  84. anim_7_x=new Array(20,20,-3,-9,-13,-27,-33,-44,-54,-66,-77,-95,-107,-136,-150,-160,-164,-168,-171,-172,-172,-176,-175);
  85. anim_7_y=new Array(-20,-26,-43,-63,-89,-116,-145,-169,-201,-222,-240,-253,-254,-245,-220,-195,-160,-124,-81,-53,-26,19,68);
  86. anim_8_x=new Array(-20,20,-35,39,0,45,-1,24,-15,14,-20,35,-18,38,-11,16,49,64,81,93,100,103,109);
  87. anim_8_y=new Array(-20,-20,-32,-42,-62,-76,-89,-107,-132,-147,-173,-180,-192,-209,-236,-193,-119,-73,-24,51,95,130,188);
  88. anim_9_x=new Array(-20,-51,-89,-110,-165,-191,-228,-240,-259,-271,-277,-281,-287);
  89. anim_9_y=new Array(-20,-20,-35,-37,-34,-16,10,47,105,150,189,227,273);
  90. //  End -->
  91. </script>
  92. <body onload="initStars()">

  93. <div id="sparks"><div id="sDiv0" style="position:absolute; visibility: hidden;">
  94. <p></font><font color="red">☆ </font></p>
  95. </div><div id="sDiv1" style="position:absolute; visibility: hidden;">

  96. <p></font><font color="yellow">☆ </font></p>
  97. </div><div id="sDiv2" style="position:absolute; visibility: hidden;"><font
  98. face="arial black" color="#3399ff">

  99. <p></font><font color="#3399ff">☆ </font></p>
  100. </div><div id="sDiv3" style="position:absolute; visibility: hidden;"><font
  101. face="arial black" color="#ff6600">

  102. <p></font><font color="#ff6600">☆ </font></p>
  103. </div><div id="sDiv4" style="position:absolute; visibility: hidden;"><font
  104. face="arial black" color="#ff9900">

  105. <p></font><font color="#ff9900">☆ </font></p>
  106. </div><div id="sDiv5" style="position:absolute; visibility: hidden;"><font
  107. face="arial black" color="white">

  108. <p></font><font color="white">☆ </font></p>
  109. </div><div id="sDiv6" style="position:absolute; visibility: hidden;"><font
  110. face="arial black" color="Lime">

  111. <p></font><font color="Lime">☆ </font></p>
  112. </div><div id="sDiv7" style="position:absolute; visibility: hidden;"><font
  113. face="arial black" color="#66ffff">

  114. <p></font><font color="#66ffff">☆ </font></p>
  115. </div><div id="sDiv8" style="position:absolute; visibility: hidden;"><font
  116. face="arial black" color="#ffff99">

  117. <p></font><font color="#ffff99">☆ </font></p>
  118. </div><div id="sDiv9" style="position:absolute; visibility: hidden;"><font
  119. face="arial black" color="#ff66ff">

  120. <p></font><font color="#ff66ff">☆ </font></p>
  121. </div>
复制代码
回复

使用道具 举报

hufanyun 发表于 2005-8-27 16:47:42 | 显示全部楼层
加了2点威望努力
回复

使用道具 举报

 楼主| jimmyjimmyqqq 发表于 2005-8-27 22:35:30 | 显示全部楼层
原帖由 默契网管 于 2005-8-27 16:26 发表
打开 header.htm

查找  

  1. <head>
复制代码


在下面加入

[code]<script>
<!-- Begin
var ver  = navigator.appVersion;
var dom  = document.getElementById ? 1 : 0;
var ie5   ...

加到最下面就可以了!
回复

使用道具 举报

 楼主| jimmyjimmyqqq 发表于 2005-8-27 22:36:08 | 显示全部楼层
原帖由 ngkwunlun990 于 2005-8-27 16:21 发表
你的演示!表示安裝後會很LAG~~~=_=

不會的,是看你個人電腦規格...
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-22 01:32 , Processed in 0.028467 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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