atomicrabbit Posted February 16, 2009 Share Posted February 16, 2009 how do I do it??? I searched google and came up with a few solutions, but none seem to fit my needs, or they just didnt work. I'm using this code in the html: <td id="showcase1"> <a href="link_goes_here" id="showcase1_link1" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('name','','path/to/rollover_image.jpg',1)"><img src="path/to/main_image.jpg" id="showcase1_img" /></a> </td> and I found a couple different solutions to change the onmouseover/out events dynamically: link1 = document.getElementById('showcase1_link1'); // first link1.onmouseover=function(){ MM_swapImage('Another Name','','path/to/another/rollover_image.jpg',1) }; // OR // second link1.addEventListener('mouseover',MM_swapImage,false); but the first one doesn't seem to work??? and the second one does not take parameters for the 'MM_swapImage' function. Quote Link to comment Share on other sites More sharing options...
atomicrabbit Posted February 17, 2009 Author Share Posted February 17, 2009 well I sorta solved my problem. Instead of editing the onmouseover/out events, I just edited the .innerHTML attribute and changed the entire link. That was good enough for me. I spent too much time trying to figure it out. If anyone still knows how to do what I'm asking, feel free to reply! 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.