Click to See Complete Forum and Search --> : Mouseover Buttons


Smilin' Jack
09-27-2003, 06:08 AM
I am having a problem making multiple rollover buttons work.
As displayed on: www.equipmentpolice.com/home.htm,
I am able to get the first two buttons to work.
Can't figure how to do the next four below.

Thanks,
Jack

Khalid Ali
09-27-2003, 08:19 AM
try the link below....

http://www.webapplikations.com/pages/html_js/image_examples/SimpleImageSwap.html

tinernet
09-27-2003, 09:00 AM
i find it much easier just to do the following:

<img src="[picoff]" name="button1" onmouseover="document.button1.src='[picon]'" onmouseout="document.button1.src='[picpff]'">

Khalid Ali
09-27-2003, 09:03 AM
you don't have to use

document.button1.src,instead you can make it even cleaner using

this.src = blah.gif

tinernet
09-27-2003, 09:04 AM
ahhhh very nifty thanks il remember that

Khalid Ali
09-27-2003, 09:30 AM
you are welcome:)

Smilin' Jack
09-27-2003, 04:36 PM
I don't see what you mean.
What would the script be for 4 buttons and how would they be activated?

Jack

tinernet
09-29-2003, 02:11 PM
well it basically uses the onmouseover and onmouseout evetnst o change the source of the picture. its a much easier way to do it and requires no complex functions or clutter. all you need to do is change the bits in bold to the image roots and copy the img tags for each each button where u want the button to be in ur script. the pic[num]off names shud b changed to the image u want when the buton is not being rolled over, and the pic[num]on names whud be changed to the images u want when the button is bein hovered on, both with the correct file extensions.

<img src='pic1off' name='button1' OnMouseOver="this.src='pic1on'" OnMouseOut="this.src='pic1off'">
<img src='pic2off' name='button2' OnMouseOver="this.src='pic2on'" OnMouseOut="this.src='pic2off'">
<img src='pic3off' name='button3' OnMouseOver="this.src='pic3on'" OnMouseOut="this.src='pic3off'">
<img src='pic4off' name='button4' OnMouseOver="this.src='pic4on'" OnMouseOut="this.src='pic4off'">