鼠标悬停在input框上,就会使input框不停地变化颜色 - 中国WEB开发者网络 (http://www.webasp.net) -- 网页特效 (http://www.webasp.net/javascript/) --- 鼠标悬停在input框上,就会使input框不停地变化颜色 (http://www.webasp.net/javascript/1/490.htm) |
| -- 发布日期: 2005-06-14 |
| <!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! --> <!-- 要实现此效果需要 1 个步骤: --> <!-- 第 1 步: --> <!-- 把下面的代码加到<BODY></BODY>区域中: --> <script language="javascript"> function flasher(){ var swap = new Array(3) swap[0]="yellow" swap[1]="red" swap[2]="blue" swap[3]="green" swap[4]="skyblue" swap[5]="salmon" swap[6]="purple" swap[7]="pink" var i =Math.floor(Math.random() * 6) + 1 document.flash.button1.style.backgroundColor=swap[i] document.flash.button1.style.color="yellow" Stop=setTimeout("flasher()",50) } function stopFlash(){ clearTimeout(Stop) } </script> <form name="flash"> <input type="button" name="button1" value="鼠标悬停颜色" onMouseOver="flasher()" onMouseOut="stopFlash()"> </form> |
| webasp.net |