How can I create several javascript image buttons?
|
05-08-2014, 05:41 PM
Post: #1
|
|||
|
|||
How can I create several javascript image buttons?
Hi,
I am new at creating websites in html. I use free for all SeaMonkey software. So, I want to create several image buttons which would change when user moves the mouse over the image. I already have created 3 images for the different stages of each button (normal, active and clicked). I wrote this code for first button: <body> <a href="first.html" onmouseover="return changeImage(jsbutton)" onmouseout="return changeImageBack(jsbutton)"> <img name="jsbutton" src="first normal.png" alt="first"> <script type="text/javascript"> function changeImage() { document.images["jsbutton"].src= "first active.png"; return true; } function changeImageBack() { document.images["jsbutton"].src = "first normal.png"; return true; } </script> </a> </body> And It works. But when I did the same for second button it didn't worked and in addition first one has stopped to work too. So, what I have to change to make it work properly? Ads |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
How can I create several javascript image buttons? - 266 - 05-08-2014 05:41 PM
|
User(s) browsing this thread: 1 Guest(s)