views:

5131

answers:

3

HTML markup:

    <ul id="portfolio"><li class="web">
   <span class="info">August 2007 <a href="http://awebsite.com" rel="external">visit</a></span>
   <a href="/assets/image.jpg" class="fancybox" rel="web">
    <img src="/assets/imagelarge.jpg" alt="Rising Star Ranch" />
    <span class="title">Some Title</span> Some other text...
   </a>
  </li>
 </ul>

jQuery:

$("ul#portfolio li").fadeTo("slow", 0.3);

In Firefox 3 and 3.5 as well as IE7, this behaves as expected and fades out all elements within the 'li'. In IE8, nothing is faded at all, and no Javascript errors show up when debugging.

The page is located at http://joecoledesign.com/portfolio

Thanks!

+1  A: 

Very cool page Joe! The only thing that comes to mind WRT IE8 is that jQuery may not have caught up to it, or that something may be funny with your browser (such as your javascript settings may be tweaked).

Brian
I tested his page in IE8 and it indeed doesn't fade. Also, jQuery's own example works fine in IE8.
Artem Russakovskii
Thanks for the comment on the page ;)Browser Javascript is definitely just the default... I'm fairly certain this is the first time I've opened it since I installed IE8 :PI'm pretty sure that jQuery is actually applying the style too, because if you look at the source using the IE8 Developer Tools and refresh the Developer Tools source after choosing a filter, it shows the style as "style='filter: alpha(opacity=30); ZOOM: 1;'"Seems like an IE8 bug maybe that it doesn't apply the fade to sub-elements?
Joe
That could be it - try to apply it to both span and img.
Artem Russakovskii
+2  A: 

Have you tried putting quotes around ul#portfolio li ? The selector is just a string, so it needs quotes. Without quotes doesn't work even in my Firefox.

$("ul#portfolio li").fadeTo("slow", 0.3);

Edit: OK, try to apply the fade to all subelements: span and img one by one for starters. It could indeed be an IE bug.

Edit: you are also missing a closing quote on the id="portfolio". Come on, man, try to work these things out before you post.

Edit: btw, the above works fine in IE8 - I just put it together and threw it up into a blank IE8 page - the whole thing faded.

Edit: It's quite possible something else on your page is doing it as it works fine standalone.

Artem Russakovskii
It has quotes, I had a variable in there and just put that directly in there for an example and forgot quotes here.
Joe
What worked for you? Applying the fade to each subelement?The missing quote on the id is because its dynamically generated and I manually typed it in when posting here... oos.
Joe
No, the whole thing, including images faded (i put in one of your image urls) when I only used your own line that fades li
Artem Russakovskii
It's some other style that is being inherited then. I have exactly that and it doesn't work...
Joe
I'm gonna mess around with it later. If I don't find anything, I'll accept your answer then... thanks so much!
Joe
There's something messing with it in the CSS for my .fancybox class. I'm gonna chalk this one up as an IE8-specific bug and figure it out later. Everything works perfectly in Chrome, Opera, Firefox and IE7, so it's not worth my time right now.Thanks so much for your quick reply and help Artem!
Joe
No problems :)
Artem Russakovskii
A: 

I was having the same problem with the transparency in IE8. Apparently IE8 has a different method of setting transparency than IE6/7. And unfortunately jquery has no way of animating transparency for IE8 yet. Why Microsoft, why?!?

http://mdasblog.wordpress.com/2009/07/24/jquery-fun-with-animation-and-opacity/

That is what I found on the subject and after reading it I gave up on trying to get it to work since it confirmed what I suspected. Hopefully jquery will have this fixed in their next release.

Billy