写给15年后再次回来的你2008岁末录音特别节目2009,我们一起走过一起来听好音乐这一季不唱寂寞
查看: 2549|回复: 12

问别人要的代码!

[复制链接]
发表于 2008-11-13 16:52:11 | 显示全部楼层 |阅读模式
发表于 2008-11-13 22:05:43 | 显示全部楼层
什么啊  
那是什么?
大东
发表于 2008-11-14 10:41:16 | 显示全部楼层
嘿嘿。帮你修改了一下帖子。你看看你用的都乱了啊

你这个叫做 鼠标跟随效果。其实有蛮多的。不过挺好玩。呵呵。在做个人主页的时候可以玩的。

你的这个 代码如下:
  1. <SCRIPT language=JavaScript>
  2. dCol='OOAA80';//date colour.
  3. fCol='OOCCOO';//face colour.
  4. sCol='FF0000';//seconds colour.
  5. mCol='FFCC00';//minutes colour.
  6. hCol='FFCC00';//hours colour.
  7. ClockHeight=40;
  8. ClockWidth=40;
  9. ClockFromMouseY=0;
  10. ClockFromMouseX=100;
  11. //Alter nothing below! Alignments will be lost!
  12. d=new Array("日期星","一期星","二期星","三期星","四期星","五期星","六期星");
  13. m=new Array("月1","月2","月3","月4","月5","月6","月7","月8","月9","月01","月11","月21");
  14. date=new Date();
  15. day=date.getDate();
  16. year=date.getYear();
  17. if (year < 2000) year=year+1900;
  18. TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;
  19. D=TodaysDate.split('');
  20. H='...';
  21. H=H.split('');
  22. M='....';
  23. M=M.split('');
  24. S='.....';
  25. S=S.split('');
  26. Face='1 2 3 4 5 6 7 8 9 10 11 12';
  27. //font='Arial';
  28. font='Verdana';
  29. size=1;
  30. speed=0.6;
  31. ns=(document.layers);
  32. ie=(document.all);
  33. Face=Face.split(' ');
  34. n=Face.length;
  35. a=size*10;
  36. ymouse=0;
  37. xmouse=0;
  38. scrll=0;
  39. props="<font face="+font+" size="+size+" color="+fCol+"><B>";
  40. props2="<font face="+font+" size="+size+" color="+dCol+"><B>";
  41. Split=360/n;
  42. Dsplit=360/D.length;
  43. HandHeight=ClockHeight/4.5
  44. HandWidth=ClockWidth/4.5
  45. HandY=-7;
  46. HandX=-2.5;
  47. scrll=0;
  48. step=0.06;
  49. currStep=0;
  50. y=new Array();x=new Array();Y=new Array();X=new Array();
  51. for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
  52. Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
  53. for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
  54. if (ns){
  55. for (i=0; i < D.length; i++)
  56. document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');
  57. for (i=0; i < n; i++)
  58. document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>');
  59. for (i=0; i < S.length; i++)
  60. document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>');
  61. for (i=0; i < M.length; i++)
  62. document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>');
  63. for (i=0; i < H.length; i++)
  64. document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>');
  65. }
  66. if (ie){
  67. document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  68. for (i=0; i < D.length; i++)
  69. document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>');
  70. document.write('</div></div>');
  71. document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  72. for (i=0; i < n; i++)
  73. document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></div>');
  74. document.write('</div></div>');
  75. document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  76. for (i=0; i < H.length; i++)
  77. document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>');
  78. document.write('</div></div>');
  79. document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  80. for (i=0; i < M.length; i++)
  81. document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>');
  82. document.write('</div></div>')
  83. document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  84. for (i=0; i < S.length; i++)
  85. document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>');
  86. document.write('</div></div>')
  87. }
  88. (ns)?window.captureEvents(Event.MOUSEMOVE):0;
  89. function Mouse(evnt){
  90. ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
  91. xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
  92. }
  93. (ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
  94. function ClockAndAssign(){
  95. time = new Date ();
  96. secs = time.getSeconds();
  97. sec = -1.57 + Math.PI * secs/30;
  98. mins = time.getMinutes();
  99. min = -1.57 + Math.PI * mins/30;
  100. hr = time.getHours();
  101. hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
  102. if (ie){
  103. Od.style.top=window.document.body.scrollTop;
  104. Of.style.top=window.document.body.scrollTop;
  105. Oh.style.top=window.document.body.scrollTop;
  106. Om.style.top=window.document.body.scrollTop;
  107. Os.style.top=window.document.body.scrollTop;
  108. }
  109. for (i=0; i < n; i++){
  110. var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;
  111. F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
  112. F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
  113. }
  114. for (i=0; i < H.length; i++){
  115. var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;
  116. HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
  117. HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);
  118. }
  119. for (i=0; i < M.length; i++){
  120. var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;
  121. ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
  122. ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);
  123. }
  124. for (i=0; i < S.length; i++){
  125. var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;
  126. SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
  127. SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);
  128. }
  129. for (i=0; i < D.length; i++){
  130. var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;
  131. DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
  132. DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
  133. }
  134. currStep-=step;
  135. }
  136. function Delay(){
  137. scrll=(ns)?window.pageYOffset:0;
  138. Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
  139. Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
  140. for (i=1; i < D.length; i++){
  141. Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
  142. Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
  143. }
  144. y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
  145. x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
  146. for (i=1; i < n; i++){
  147. y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
  148. x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
  149. }
  150. ClockAndAssign();
  151. setTimeout('Delay()',20);
  152. }
  153. if (ns||ie)window.onload=Delay;
  154. </SCRIPT>
复制代码
发表于 2008-11-14 10:50:29 | 显示全部楼层
<P>好复杂。。。天书呵。。。 <IMG src="http://www.kltx.net/images/smilies/alww/y22.gif" border=0></P>
<P>&nbsp;</P>
<P>不过看到效果了,满好玩的</P>
发表于 2008-11-14 10:53:22 | 显示全部楼层
好复杂哦,晕。。。

[ 本帖最后由 懒猫悠悠 于 2008-11-14 11:01 编辑 ]
发表于 2008-11-14 10:55:11 | 显示全部楼层
face25; 猫猫你要是使用的话。得勾选左侧的项目

在发帖子的时候,你要将左侧的那些URL、Smilies、Discuz!代码选项都禁用了。然后启用 HTML 代码。你就会会看到效果了。
发表于 2008-11-14 10:56:51 | 显示全部楼层
<P><IMG src="http://www.kltx.net/images/smilies/alww/y16.gif" border=0><IMG src="http://www.kltx.net/images/smilies/alww/y16.gif" border=0>不会用呵</P>

[ 本帖最后由 懒猫悠悠 于 2008-11-14 10:59 编辑 ]
发表于 2008-11-14 11:00:57 | 显示全部楼层
原帖由 懒猫悠悠 于 2008-11-14 10:56 发表
不会用呵

这样。你新开一个帖子。到音画试帖区去开个帖子。
然后复制这个代码。按我说的做。会有效果的。
发表于 2008-11-14 11:02:47 | 显示全部楼层
好,一定要试试看 <IMG src="http://www.kltx.net/images/smilies/alww/y03.gif" border=0>
发表于 2008-11-14 11:14:12 | 显示全部楼层
好长的代码。。。
您需要登录后才可以回帖 登录 | 非必要不注册

本版积分规则

手机版|小黑屋|分享我的生活 kltx.vip ( 京ICP备2022033851号-1 )

GMT+8, 2025-1-31 03:26

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

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