allistera Posted May 1, 2008 Share Posted May 1, 2008 Hey there, I have made a simple JS mouse over: function mouseOver() { document.home.src ="images/homeO.gif"; } function mouseOut() { document.home.src ="images/home.gif"; } <img src="images/home.gif" id="home" onmouseout="mouseOut()" onmouseover="mouseOver()" alt="Home" /> Works fine in firefox, but not in IE, I don't know JS, just this simple mouseOver. Any help? Thanks Link to comment https://forums.phpfreaks.com/topic/103764-solved-simple-mouseover/ Share on other sites More sharing options...
rhodesa Posted May 1, 2008 Share Posted May 1, 2008 try this instead: function mouseOver(ele, path) { ele.src = path; } function mouseOut(ele, path) { ele.src = path; } <img src="images/home.gif" id="home" onmouseout="mouseOut(this,'images/home.gif')" onmouseover="mouseOver(this,'images/homeO.gif')" alt="Home" /> it's more generic too, so you can use it in several places Link to comment https://forums.phpfreaks.com/topic/103764-solved-simple-mouseover/#findComment-531256 Share on other sites More sharing options...
GameYin Posted May 1, 2008 Share Posted May 1, 2008 or window.location.href Link to comment https://forums.phpfreaks.com/topic/103764-solved-simple-mouseover/#findComment-531257 Share on other sites More sharing options...
rhodesa Posted May 1, 2008 Share Posted May 1, 2008 or window.location.href or, read the post again Link to comment https://forums.phpfreaks.com/topic/103764-solved-simple-mouseover/#findComment-531259 Share on other sites More sharing options...
allistera Posted May 1, 2008 Author Share Posted May 1, 2008 Thanks rhodesa, works now One more thing, have a look at this: http://allistera.110mb.com/bookmarks.html I used mootools to get the effect, this also works fine in firefox, but not in IE for some strange reason. Link to comment https://forums.phpfreaks.com/topic/103764-solved-simple-mouseover/#findComment-531267 Share on other sites More sharing options...
GameYin Posted May 1, 2008 Share Posted May 1, 2008 Why did I haveto read the post again? What did I miss ??? Link to comment https://forums.phpfreaks.com/topic/103764-solved-simple-mouseover/#findComment-531289 Share on other sites More sharing options...
rhodesa Posted May 1, 2008 Share Posted May 1, 2008 Why did I haveto read the post again? What did I miss ??? window.location.href is for changing the page...he just wants the SRC of an image to change on mouseover Link to comment https://forums.phpfreaks.com/topic/103764-solved-simple-mouseover/#findComment-531293 Share on other sites More sharing options...
allistera Posted May 1, 2008 Author Share Posted May 1, 2008 Never mind got it to work Thanks both of you! Link to comment https://forums.phpfreaks.com/topic/103764-solved-simple-mouseover/#findComment-531334 Share on other sites More sharing options...
GameYin Posted May 2, 2008 Share Posted May 2, 2008 Oh. Link to comment https://forums.phpfreaks.com/topic/103764-solved-simple-mouseover/#findComment-531622 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.