Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Color my dot_small.gif when mouseover it.

Status
Not open for further replies.

vemate

Programmer
Aug 23, 2002
61
US
Please help me with code to make my gold button change colors to "red" when touched. I have a table of contents with a number of buttons.

<tr><td><a href="index_table.htm"><img src="dot_small.gif" border="0" width="20" height="20" "border=0 alt="Click Here!><a href="index_table.htm" target="_top" ><font color="blue" size=2><b><I>&nbsp;&nbsp;Support and Passwords</i></b></a>

I have tried a number of things that do not work..
Thanks
 
you can do the with CSS using the pseudo class Hover.
Google it to get all the details.

Kevin Petursson
 
use this for rollover image change...i have included a 2px border to illustrate the color change.

Code:
<script>
buttonState='off';
function setButton(x) {
 if (buttonState=='off') {
 document.getElementById(x).src='image1_red.gif'; 
 document.getElementById(x).style.border="2px solid red";
 buttonState='on';
 }
 else {
 document.getElementById(x).src='image1_gold.gif'; 
 document.getElementById(x).style.border="2px solid gold";
 buttonState='off';
 }
}
</script>
<a href='' onMouseover=setButton('button1') onMouseout=setButton('button1')><img src='image1_gold.gif' style='border:2px solid gold;' id=button1></a>

hope that helps.

- g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top