Hello everyone,
I want to change the size of the image when my mouse moves over it. I write some code but doesn't work.
In the page HTML:
And I import the code in the <head>:HTML Code:<img src="11-1.bmp" name="b1" id="b2" style="width:40px; height:30px;" onmouseover="mouseOver()" onmouseout="mouseOut()"/>
this is the code in the js document:HTML Code:<head> <script type="text/javascript" src="changeImg.js"> </script> </head>
when I move my mouse over the pic, nothing happened, but if I test with:Code:function mouseOver() { document.document.getElementById("b2").style.width=80; document.document.getElementById("b2").style.height=60; } function mouseout().....
the window of alert works normally. And I have tested with firefox, safari, so it is not the problem of browser.Code:function mouseOver() { alert("something") }
So, what happened? HTML can't accept the of changing size like this?
Thank you very much!


Reply With Quote

Bookmarks