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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
GameYin Posted May 1, 2008 Share Posted May 1, 2008 or window.location.href Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 ??? Quote Link to comment 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 Quote Link to comment 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! Quote Link to comment Share on other sites More sharing options...
GameYin Posted May 2, 2008 Share Posted May 2, 2008 Oh. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.