Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery - Animating opacity in IE8

On the site I'm currently working on I have an <ul> containing a load of <li>'s, which each contain <div>, <span>, <img> etc.

When I hover over one of the <li>'s, I'm using jQuery to animate the opacity of all the other <li>'s to 0.3 to draw attention to the focused <li>.

My problem is IE8 (and only IE8) is animating the <li>'s opacity, but none of the child elements within that <li>.

Anybody come across this issue before, or know of a fix?

Thanks!

EDIT:

Please see the following jsFiddle for an example - http://jsfiddle.net/BJ8gK/22/

like image 640
Probocop Avatar asked Dec 04 '22 19:12

Probocop


1 Answers

I had a similar problem - in IE8 order to ensure child elements' opacity is also affected when changing the opacity of their parent element you have to apply the css rule

filter:inherit

to the child elements. Simple fix, but perhaps obscure

like image 75
Buzz Robinson Avatar answered Dec 07 '22 22:12

Buzz Robinson