Using Mouse Over function in javascript

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
hexColor = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];
function mOver() {
for (i = 0; i < 13; i++) {
setTimeout('document.myForm.button.style.background = "#'+hexColor[12-i]+'0'+hexColor[12-i]+'0c0";', i * 30);
   }
}
function mOut() {
document.myForm.button.value = "  Click Here!  ";
for (i = 0; i < 12; i++) {
setTimeout('document.myForm.button.style.background = "#'+hexColor[i]+'0'+hexColor[i]+'0c0";', i * 30);
   }
}
</script>

</HEAD>

<BODY>

<form name=myForm>
<input type=button name=button value="  Click Here!  " onMouseOver='mOver()'' onMouseDown='document.myForm.button.value="Thanks!"' onMouseOut='mOut()'>
</form>

Ebook Download
View all
Learn
View all