Diễn đàn Trái Tim Yên Bái 2024

 Quên mật khẩu
 Đăng ký
Xem: 3661|Trả lời: 4
Thu gọn cột thông tin

Tạo đồng hồ bay theo chuột

[Lấy địa chỉ]
  • Tâm trạng hàng ngày
    Suy ngẫm
    22-4-2024 05:18 PM
  • Đã viết: 4 ngày

    [LV.2]Spam 2

    Đăng lúc 11-4-2008 07:14 PM | Xem tất |Chế độ đọc

    Mời bạn đăng ký để giao lưu kết bạn nhé <3

    Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký

    x
    Trang trí cho chuột

    đây là đoạn code trang trí cho chuột khi làm web,khi chèn đaọn code này vào giữa thẻ BODY sẽ hiện thêm 1 đồng hồ di chuyển theo chuột, muốn đồng hố chay đúng giờ thì bạn cài đặt thời gian & ngày tháng trong máy của bạn(, trong control panel ):
    1. <script language="JavaScript">
    2. <!-- Silly Clock 1 crazy000crazy@yahoo.com
    3. dCol='red';//date colour.
    4. fCol='red';//face colour.
    5. sCol='green';//seconds colour.
    6. mCol='black';//minutes colour.
    7. hCol='red';//hours colour.
    8. ClockHeight=40;
    9. ClockWidth=40;
    10. ClockFromMouseY=0;
    11. ClockFromMouseX=100;
    12. //Alter nothing below! Alignments will be lost!
    13. d=new Array("MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY");
    14. m=new Array("JANUARY","FEBRUARY","MARCH","AUGUST","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER");
    15. date=new Date();
    16. day=date.getDate();
    17. year=date.getYear();
    18. if (year < 2000) year=year+1900;
    19. TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;
    20. D=TodaysDate.split('');
    21. H='...';
    22. H=H.split('');
    23. M='....';
    24. M=M.split('');
    25. S='.....';
    26. S=S.split('');
    27. Face='1 2 3 4 5 6 7 8 9 10 11 12';
    28. font='Arial';
    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. //-->
    155. </script>
    Sao chép mã
    Đăng lúc 28-6-2008 10:53 AM | Xem tất
    bạn ơi hình như nó có ở
    http://www.download.com.vn/Devel ... aScript?op=download
    lên đây download nhiều hơn có đủ thể loại
    Đăng lúc 29-8-2008 12:44 AM | Xem tất
    cho mình hỏi cái thẻ body nó nằm ở đâu vậy mấy bạn? làm ơn chỉ giùm mới biết sơ sơ về máy tính à ( gà lắm)
  • Tâm trạng hàng ngày
    Hạnh phúc
    2-7-2025 09:43 PM
  • Đã viết: 13 ngày

    [LV.3]Spam 3

    Đăng lúc 29-8-2008 07:46 AM | Xem tất
    trong html bao h cũng có thẻ body...nếu thiếu thì tự thêm vào <body> và </body>

    cứ thư đặt java ở các chỗ khác nhau chỗ nào chạy là đc
    Đăng lúc 29-8-2008 09:08 AM | Xem tất
    anh ruồi bâu kũng sáng tạo ra phết sờ nhỷ
    Bạn phải đăng nhập mới được đăng bài Đăng nhập | Đăng ký

    Quy tắc điểm

    Đóng

    Thông báoTrước /1 Sau

    Phòng tối|Lưu trữ|Diễn đàn Yên Bái 2024 Community Guidelines |

    GMT+7, 6-12-2026 02:56 AM , Processed in 0.022893 second(s), 19 queries .

    Powered by Discuz! X3.4

    © 2001-2013 Comsenz Inc.

    Trả lời nhanh Lên trên Trở lại danh sách