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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Cell Background Change Color on Hover

Status
Not open for further replies.

JordanR

Technical User
Oct 3, 2002
182
US
Could someone tell me how this is done,
when there is a hover on a link the table cell background color changes?
I have seen it on some sites and I don't think that the link was an image.

TIA
JordanR
 
Code:
<HTML>
<HEAD>

<script language=&quot;javascript&quot;>
  function highlightCell(link, isHighligh){
    if(isHighligh){
      link.parentElement.style.backgroundColor = &quot;green&quot;
    }
    else{
      link.parentElement.style.backgroundColor = &quot;white&quot;;
    }
  }
</script>
</HEAD>

<BODY>
<table>
  <tr>
    <td>
       <a href=&quot;[URL unfurl="true"]http://www.microsoft.com&quot;[/URL] onmouseover=&quot;javascript:highlightCell(this, true)&quot; onmouseout=&quot;javascript:highlightCell(this, false)&quot;>MS</a>
    </td>
  </tr>
</table>
</BODY>
</HTML>

Hope this helps.
 
one thing is that lv that is way more complicated then it need be.

second this is a dead horse beaten, and beaten over. Search the forum and you will find oodles and oodles of threads on this one.

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
Huh... Interesting, I don't see anything that is &quot;way more complicated then it need be&quot;, looks like a very simple javascript to me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top