Hemlock Posted November 2, 2009 Share Posted November 2, 2009 Evening,Not sure what I am doing wrong here in particulair, but I thought this should work. <script language="JavaScript"> <!-- Start news = new Image(); news.src = 'imageWeb/newsOn.png'; //End --> </script><a href="news.html" onmouseover="news.src=imageWeb/newsOn.png;" onmouseout="news.src=imageWeb/newsOut.png;"><img src="imageWeb/newsOut.png" alt="news" width="172px" height="45px" name="news" /></a> Or am I missing something here, cause they different images are not being displayed. Link to comment Share on other sites More sharing options...
chibineku Posted November 3, 2009 Share Posted November 3, 2009 it'll need to have id="news" not just name="news" Link to comment Share on other sites More sharing options...
norNerd Posted November 7, 2009 Share Posted November 7, 2009 Thought <a href="site"><img src="image.jpg" onmouseover="this.src='imgover.jpg'" onmouseout="this.src='image.jpg'" /></a> Was better to use?Or is it any problem doing it this way?Kris Link to comment Share on other sites More sharing options...
jeffman Posted November 7, 2009 Share Posted November 7, 2009 If it works, it works. :)Have you considered using sprites and the CSS :hover class? http://www.w3schools.com/css/tryit.asp?fil...rites_hover_nav Link to comment Share on other sites More sharing options...
norNerd Posted November 7, 2009 Share Posted November 7, 2009 When you say it, i actually think i've used it with images once, but normally just as a regular hover.Great to have many solutions in mind :)Thanks for the reminder Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.