THINK

that’s how i naturally know

Archive for the ‘hover’ tag

:hover not allowed in IE other than on anchors

leave a comment

The CSS :hover event is only supported for the anchor element <a> and hence to simulate the correct :hover behavior for other elements such as td:hover, we need a javascript hack.

The idea is to change the class of the hoverable element so that the CSS can be applied to the class i.e. td.hoverable.

To do this, we attach a function to the onmouseover and onmouseout events of the element to add an remove the class name respectively.

Written by Jake

January 24th, 2009 at 11:31 pm

Posted in Programming,Web

Tagged with , , ,