views:

139

answers:

1

Hey,

I've created a site with CSS that requires the :focus pseudo class. I change the 'filter' and 'background-image' effects when a textbox is selected (i.e. has focus). This works in Chrome/FF, but doesn't seem to work in IE8 (and, presumable, previous versions if IE). I tried to look for answers, and have tried to use :active - but that doesn't work. Is there a way of changing attributes such as 'filter' using psuedo-classes? Failing that, can I do it in JS with the OnClick event?

Thanks

A: 

Pseudo-classes on IE: whatever:hover

Most modern browsers support the :hover selector for any html element. This is cool, because it enables you to, for instance, apply a mouseover effect to table rows using only CSS. IE however, has an erratic support for :hover at best, depending on the particular version your visitor is using.

Whatever:hover is a small script that automatically patches :hover, :active and :focus for IE6, IE7 and IE8 quirks, letting you use them like you would in any other browser. Version 3 introduces ajax support, meaning that any html that gets inserted into the document via javascript will also trigger :hover, :active and :focus styles in IE.

http://www.xs4all.nl/~peterned/csshover.html

TiuTalk