SitePoint Sponsor |
|
User Tag List
Results 1 to 1 of 1
Thread: Mouse over won't work
-
Jul 12, 2006, 13:37 #1
- Join Date
- Jul 2006
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Mouse over won't work
Hi, all! Thanks for helping me out. I am pretty new to web design; but I'm kind of proud of my first personal site. I am using it as a practice field, getting ready to have my own online business in the near future. Thank goodness, I found SitePoint! I followed the instructions in the article for the mouseover effect - exactly what I was looking for. However, no matter what I do, the mouseoff image will not change to the mouseon image. Can someone tell me why?
Code:<HTML><head> <title>DANDY NEWS GALLERY</title> <SCRIPT LANGUAGE="JavaScript"> <!-- Hide from older browsers if (document.images) { var first_off = new Image(); var first_on = new Image(); var second_off = new Image(); var second_on = new Image(); var third_off = new Image(); var third_on = new Image(); } function loadImages() { if (document.images) { first_off.src = "http://home.comcast.net/~thephoenixnest/donnabefore.jpg"; first_on.src = "http://home.comcast.net/~thephoenixnest/donnaafter.jpg"; second_off.src = "http://home.comcast.net/~thephoenixnest/courduffbefore.jpg"; second_on.src = "http://home.comcast.net/~thephoenixnest/courduffafter.jpg"; third_off.src = "http://home.comcast.net/~thephoenixnest/nikki2before.jpg"; third_on.src = "http://home.comcast.net/~thephoenixnest/nikki2after.jpg"; } } function activate(imgName) { if (document.images) { if ( eval(imgName + "_on.complete") ) { document.images[imgName].src = eval(imgName + "_on.src"); } } } function deactivate(imgName) { if (document.images) { if ( eval(imgName + "_off.complete") ) { document.images[imgName].src = eval(imgName + "_off.src"); } } } // End script hiding --> </SCRIPT> </head> <body> <A HREF="javascript:void(0)" onMouseOver="activate('first')" onMouseOut="deactivate('first')"><IMG SRC="http://home.comcast.net/~thephoenixnest/donnabefore.jpg" ALIGN="TOP" WIDTH="300" HEIGHT="220" BORDER="0" NAME="first"></A> <A HREF="javascript:void(0)" onMouseOver="activate('second')" onMouseOut="deactivate('second')"><IMG SRC="http://home.comcast.net/~thephoenixnest/courduffbefore.jpg" ALIGN="TOP" WIDTH="300" HEIGHT="220" BORDER="0" NAME="second"></A> <A HREF="javascript:void(0)" onMouseOver="activate('third')" onMouseOut="deactivate('third')"><IMG SRC="http://home.comcast.net/~thephoenixnest/nikki2before.jpg" ALIGN="TOP" WIDTH="300" HEIGHT="220" BORDER="0" NAME="third"></A> </body></html>
Bookmarks