RE: CSS - attach cell properties to hover?

by Keith Purtell <kpurtell(at)vantagemed.net>

 Date:  Mon, 3 Apr 2000 12:03:04 -0500
 To:  <hwg-languages(at)hwg.org>
  todo: View Thread, Original
Alexander:

That is *very* interesting. I like that it works when I mouseover the cell
and not just the link! I added BGCOLOR to stop it from defaulting to white
when the page first loads. It seems to limit me to one cell? If I add
another cell I get an error message "document.all.tobehovered.style is not
an object". And it degrades OK in Netscape; no conflicts.

<TABLE border="1" CELLSPACING="0" CELLPADDING="36">
    <TR>
      <TD ID="tobehovered" onMouseOver="hoverTD('CCCCFF')"
onMouseOut="hoverTD('CCCCCC')" BGCOLOR="CCCCCC"><A
href="test.html">LINK</A></TD>
    </TR>
  </TABLE>

Keith Purtell, Web Designer


> -----Original Message-----
> From: Alexander Feninga [mailto:gassinaumasis(at)hotmail.com]
> Sent: Wednesday, March 29, 2000 9:37 AM
> To: kpurtell(at)vantagemed.net
> Subject: Re: CSS - attach cell properties to hover?
>
>
> Is it possible in CSS to have other properties attached to
> IE's "hover"
> >property? I'd like to make a table cell's background color
> change when the
> >user points to a link within that cell.
>
> Can't do it with CSS, but try JavaScript.
>
> <TD ID="tobehovered" onMouseOver="hoverTD('000000')"
> onMouseOut="hoverTD('ffffff')">
>
> function hoverTD(color)
> {
>    document.all['tobehovered'].style.background = '#' + color;
> }
>
> This sets the bg to black onMouseOver and white onMouseOut.
> Only works in IE4/5

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA