免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享
返回列表 發帖

[分享] 代碼測試器

本帖最後由 yoyo 於 2012-4-13 21:34 編輯

一個代碼文盲,搗鼓了一個晚上,終於弄出了一個稍微像樣的東西了。
這代碼測試器,只要你把要運行的代碼粘貼到窗口中,然後點擊“code running”即可測試運行,這樣就修改代碼什麼的就很方便查看效果的效果了。
“Join collection”是收藏鍵,點不點無所謂,還有個是……

為什麼全是英文??因為中文會變成口口口口……

覺的還不錯的朋友,就回覆個吧

01.jpg
2012-4-13 21:34



點我進入

備用鏈接

01.jpg
2012-4-12 23:25



效果測試代碼:
  1. <body><SCRIPT language=JavaScript>
  2. var r=0
  3. var a=11,b=9,c=7,d=10,e=11,f=8;
  4. var y2=-25,y1=-25,y3=-25,y4=-25,y5=-25,y6=-25;
  5. var x1=305,x2=335,x3=365,x4=395,x5=425,x6=455;
  6. function setVariables(){
  7. if (navigator.appName == "Netscape") {
  8. horz=".left";
  9. vert=".top";
  10. visShow="'show'";
  11. visHide="'hide'";
  12. docStyle="document.";
  13. styleDoc="";
  14. }else{
  15. horz=".pixelLeft";
  16. vert=".pixelTop";
  17. visHide="'hidden'";
  18. visShow="'visible'";
  19. docStyle="";
  20. styleDoc=".style";
  21. }
  22. }
  23. function startbounce1(){
  24. objectX1="object1"
  25. y1 += a
  26. evalMove1()
  27. if (y1<210) setTimeout("startbounce1()",20)
  28. else bounce1()
  29. }
  30. function bounce1(){
  31. if (y1>201) a=11-r,r=Math.random()*100/25,Math.round(r);
  32. y1 -= a
  33. if (y1<100) a -= .5
  34. evalMove1()
  35. if (y1>-100) setTimeout("bounce1()",10)
  36. else toggle()
  37. }
  38. function startbounce2(){
  39. objectX2="object2"
  40. y2 += b
  41. evalMove2()
  42. if (y2<210) setTimeout("startbounce2()",20)
  43. else bounce2()
  44. }
  45. function bounce2(){
  46. if (y2>201) b=8+r
  47. y2 -= b
  48. if (y2<100) b -= .5
  49. evalMove2()
  50. if (y2>-100) setTimeout("bounce2()",20)
  51. else toggle()
  52. }
  53. function startbounce3(){
  54. objectX3="object3"
  55. y3 += c
  56. evalMove3()
  57. if (y3<210) setTimeout("startbounce3()",20)
  58. else bounce3()
  59. }
  60. function bounce3(){
  61. if (y3>201) c=7+r
  62. y3 -= c
  63. if (y3<100) c -= .5
  64. evalMove3()
  65. if (y3>-100) setTimeout("bounce3()",10)
  66. else toggle()
  67. }
  68. function startbounce4(){
  69. objectX4="object4"
  70. y4 += d
  71. evalMove4()
  72. if (y4<210) setTimeout("startbounce4()",20)
  73. else bounce4()
  74. }
  75. function bounce4(){
  76. if (y4>201) d=8+r
  77. y4 -= d
  78. if (y4<100) d -= .5
  79. evalMove4()
  80. if (y4>-100) setTimeout("bounce4()",20)
  81. else toggle()
  82. }
  83. function startbounce5(){
  84. objectX5="object5"
  85. y5 += e
  86. evalMove5()
  87. if (y5<210) setTimeout("startbounce5()",10)
  88. else bounce5()
  89. }
  90. function bounce5(){
  91. if (y5>201) e=12-r
  92. y5 -= e
  93. if (y5<100) e -= .5
  94. evalMove5()
  95. if (y5>-100) setTimeout("bounce5()",20)
  96. else toggle()
  97. }
  98. function startbounce6(){
  99. objectX6="object6"
  100. y6 += f
  101. evalMove6()
  102. if (y6<210) setTimeout("startbounce6()",10)
  103. else bounce6()
  104. }
  105. function bounce6(){
  106. if (y6>201) f=8+r
  107. y6 -= f
  108. if (y6<100) f -= .5
  109. evalMove6()
  110. if (y6>-100) setTimeout("bounce6()",10)
  111. else toggle()
  112. }
  113. function evalMove6(){
  114. eval(docStyle + objectX6 + styleDoc + horz + '=' + x6);
  115. eval(docStyle + objectX6 + styleDoc + vert + "=" + y6);
  116. }
  117. function evalMove5(){
  118. eval(docStyle + objectX5 + styleDoc + horz + '=' + x5);
  119. eval(docStyle + objectX5 + styleDoc + vert + "=" + y5);
  120. }
  121. function evalMove4(){
  122. eval(docStyle + objectX4 + styleDoc + horz + '=' + x4);
  123. eval(docStyle + objectX4 + styleDoc + vert + "=" + y4);
  124. }
  125. function evalMove3(){
  126. eval(docStyle + objectX3 + styleDoc + horz + '=' + x3);
  127. eval(docStyle + objectX3 + styleDoc + vert + "=" + y3);
  128. }
  129. function evalMove2(){
  130. eval(docStyle + objectX2 + styleDoc + horz + '=' + x2);
  131. eval(docStyle + objectX2 + styleDoc + vert + "=" + y2);
  132. }
  133. function evalMove1(){
  134. eval(docStyle + objectX1 + styleDoc + horz + '=' + x1);
  135. eval(docStyle + objectX1 + styleDoc + vert + "=" + y1);
  136. }
  137. </SCRIPT>
  138. <DIV id=object1 style="LEFT: 125px; POSITION: absolute; TOP: -50px; Z-INDEX: 2">
  139. <CENTER>
  140. <TBODY>
  141. <TR>
  142. <TD><FONT color#750000>
  143. <CENTER><B>鄙</B></CENTER></FONT></TD></TR></TBODY></TABLE></DIV>
  144. <DIV id=object2 style="LEFT: 125px; POSITION: absolute; TOP: -50px; Z-INDEX: 2">
  145. <TBODY>
  146. <TR>
  147. <TD><FONT color#750000>
  148. <CENTER><B>視</B></CENTER></FONT></TD></TR></TBODY></TABLE></DIV>
  149. <DIV id=object3 style="LEFT: 185px; POSITION: absolute; TOP: -50px; Z-INDEX: 2">
  150. <TBODY>
  151. <TR>
  152. <TD><FONT color#750000>
  153. <CENTER><B>伸</B></CENTER></FONT></TD></TR></TBODY></TABLE></DIV>
  154. <DIV id=object4 style="LEFT: 215px; POSITION: absolute; TOP: -50px; Z-INDEX: 2">
  155. <TBODY>
  156. <TR>
  157. <TD><FONT color#750000>
  158. <CENTER><B>手</B></CENTER></FONT></TD></TR></TBODY></TABLE></DIV>
  159. <DIV id=object5 style="LEFT: 245px; POSITION: absolute; TOP: -50px; Z-INDEX: 2">
  160. <TBODY>
  161. <TR>
  162. <TD><FONT color#750000>
  163. <CENTER><B>黨</B></CENTER></FONT></TD></TR></TBODY></TABLE></DIV>
  164. <DIV id=object6 style="LEFT: 243px; POSITION: absolute; TOP: -50px; Z-INDEX: 2">
  165. <TBODY>
  166. <TR>
  167. <TD><FONT color#750000>
  168. <CENTER><B>!</B></CENTER></FONT></TD></TR></TBODY></TABLE></DIV>
  169. <DIV id=line1
  170. style="HEIGHT: 24px; LEFT: 27px; POSITION: absolute; TOP: 215px; WIDTH: 707px; Z-INDEX: 1">
  171. <TBODY>
  172. <TR>
  173. <TD><FONT color#750000>
  174. <CENTER><B>________________________</B></CENTER></FONT></TD></TR></TBODY></TABLE></DIV>
  175. <DIV id=note
  176. style="HEIGHT: 24px; LEFT: 31px; POSITION: absolute; TOP: 237px; WIDTH: 697px; Z-INDEX: 1">
  177. <TBODY>
  178. <TR>
  179. <TD></B></FONT></TD></TR></TBODY></TABLE></DIV>
  180. <body>
  181. <body onload=setVariables(),startbounce1(),startbounce2(),startbounce3(),startbounce4(),startbounce5(),startbounce6()>
複製代碼
1

評分人數

感謝分享~支持SCLUB!

TOP

感謝您的分享

TOP

感謝分享喔~

TOP

5k4g4
這是???

TOP

謝謝拉
很好用喔

TOP

真的需要這個啊

TOP

謝謝分享

TOP

提示: 作者被禁止或刪除 內容自動屏蔽

TOP

感謝分享~支持SCLUB!

TOP

返回列表