LifeInBinary Posted April 22, 2008 Share Posted April 22, 2008 i have this in an external .js file: if(document.images) {pics = new Array(); pics[3] = new Image();pics[3].src = "images/nav_about.jpg"; pics[4] = new Image();pics[4].src = "images/nav_about_over.jpg";pics[5] = new Image();pics[5].src = "images/nav_about_click.jpg"; }function changer(from,to) {if(document.images) {document.images[from].src = pics[to].src;}} and this is in my html: <td><a onmouseover="changer('about',4)" onmouseout="changer('about',3)" onclick="changer('about',5)"><img src="images/nav_about.jpg" border="0" name="about" /></a></td> Thing is, I don't need it to link at all, i just need a few images to change on hover, and change back on mouseout - then if you click one you are hovering on, i want it to display a different image, but NOT change on mouse out.the goal is to have 3 cards my wife can choose from - each with something she gets for her birthday lol. its 3 here now, and she gets home from work at 4 - pls help QUICK :)p.s - the way i have it working so far, the hover works, and the click works, but when you click, it changes on mouseout - and i want it to stay.should be easy - help pls Link to comment Share on other sites More sharing options...
jeffman Posted April 22, 2008 Share Posted April 22, 2008 Haven't tried it and I'm past your deadline anyway, but this might work:onclick="changer('about',5); this.onmouseout=''; this.mouseover='';"those are null strings inside single quotes, BTW.The whole thing is of course self-destructive, so useless if you want to do it a second time. Somehow I got the idea that's what you're up to. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.