Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
I have four images and I have put and image on their mouse over and onmouseout but I want to click on image it show the over image and when click on second image it show over image and first image will be normal image , using JavaScript can any one help me how can I do this .




Quote:
<img id="register_img_" onmouseover="this.src='images/serve_1_hover.png'" önclick="this.src='images/serve_1_hover.png'" src="images/serve_1.png" />

<img id="register_img_2" onmouseover="this.src='images/serve_2_hover.png'" önclick="test()" src="images/serve_2.png" />

<img id="register_img_3" onmouseover="this.src='images/serve_3_hover.png'" önmouseout="this.src='images/serve_3.png'" src="images/serve_3.png" />

<img id="register_img_4" onmouseover="this.src='images/serve_4_hover.png'" önmouseout="this.src='images/serve_4.png'" src="images/serve_4.png" />

<img id="register_img_5" onmouseover="this.src='images/serve_5_hover.png'" önmouseout="this.src='images/serve_5.png'" src="images/serve_5.png" />
Posted

1 solution

This is not very clear. You want to remember which image was a popup and put it somewhere ? You need to store the popup value in a variable, and then respond to it on the next hover event. What you're doing is not going to do it, you'll need to call a method that takes the image name so you can store it and respond to it in the same method next time.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900