This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
How can I create several javascript image buttons? - 266 - 05-08-2014 05:41 PM
[] - Chris - 05-08-2014, 05:44 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)