> Julian Ray wrote:
> > Why not simply store the current background color in the 
> onmouseover event
> > and replace it in the onmouseout event?
> 
> Why not just use the :hover CSS selector? Even IE7 supports it.

I guess I left a couple of details out that may have some effect on the 
appropriate implementation:

1. I'm developing JSF-based portlets, so I cannot rely on id-referenced objects 
because id's will not necessarily ever be consistently named (the portal adds a 
prefix on ids to make them unique within a given page).

2. I'm implementing the data table to emulate functionality supported by the 
CSS used by the portal.  I therefore have to live within the CSS provided by 
the portal's themes (as I do not want to have to manually edit all of the 
portal's themes just to add the appropriate :hover style), and I wanted the 
emulation to match (as closely as possible) to the tables generated by the 
portal-provided portlets (which use onmouseover/onmouseout to restore a 
specific row style per row rather than caching current style and restoring the 
cached version).

At this point I'm thinking the cleanest path is Julian's recommendation to 
store the current style as part of the onmouseover event and restore the cached 
style in onmouseout, but I wanted to see if anyone out there had alternative 
ideas I hadn't considered.

Anyway thanks to everyone!

Dave

Reply via email to