中文(繁体)
<!-- 將以下程式碼加入<body>區域中--> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin pos = 15; TO = 空;函數 shake_funct2(object,speed) { obj = eval(object) txt = clear_space(obj.value); if (pos == 15) { txt = txt + " ";位置=-15; } else { txt = " " + txt;位置=15; } obj.value = txt; obj.style.width = parseInt(obj.style.width) + pos; obj = 物件 sp = 速度 TO = setTimeout("shake_funct2(obj,sp)",speed); } 函數clear_space(text) { while (text.substring(0,1) == " ") { text = text.substring(1,text.length); } while(text.substring(text.length-1,text.length) == " ") { text = text.substring(0,text.length-1);返回文字; } 函數 end_shake_funct2(object) { 清除逾時(TO); obj = eval(對象); txt =clear_space(obj.value); obj.value = txt; //警報(位置); if (pos == -15) { obj.style.width = parseInt(obj.style.width) +15; } pos = 15 } // End --> </script> <form name=myform2> <table border=0> <tr><td>一般睡眠的按鈕</td> <tdalign=center width=160> < input type=button value = "一般速度" style="font-size:12;width:150" onmouseover="shake_funct2(this,100)" onmouseout="end_shake_funct2(this)"> </td></tr > <tr><td> 快速旋轉的按鈕</td> <tdalign=center width=160> <input type=button value = "更快速度" style="font-size:12;width:150" onmouseover =" shake_funct2(this,50)" onmouseout="end_shake_funct2(this)"> </td></tr> </Table> </form>