views:

49

answers:

3

Hi -

I have some jQuery animations in my code to slide divs up and down in response to some mouse clicks and other logic. This is all working just peachy, however in IE 6 some of the smaller icon images on the page don't slide along with the rest of the div for some strange reason. They kind of stay put then flicker into the new position and I've chalked this up to an IE6 'feature'.

Considering that I have to support IE6, I wanted to just hide the icons anytime an animation started, and show them again when the queue was empty.

I couldn't find a reference to any kind of events or hooks into the queue itself and I'd rather not add the hide code, then the show code to every animation as a callback.

Thanks if you can help-

b

A: 

Does it do the same in IE7? Is the div or icon relative positioned?

justdev
It only did this in IE6, and the images are not relatively positioned. I couldn't find anything consistent about them other than they were very small... mVChr's solution worked for my needs...
WillyCornbread
+1  A: 

You can do this with the livequery plugin like so:

$(':animated').livequery(function() {
  // firing code here
}, function() {
  // anything you want to run when all animation stops
});

This type of functionality is the only reason that the livequery plugin is still useful actually, since otherwise its functionality has been replaced by live() and delegate()

And since this only happens in IE6, it would be silly to hide them in all browsers, so in the firing function you can add a class with an IE6 hack like .hide4IE6 { _display:none; } to let them remain shown in other browsers.

mVChr
@mhr - Did you test this? I tried it, and the function never fired. I assumed it was because there's no attribute modification (other than style).
patrick dw
@patrick - I did indeed test this on our staging server for our live site (using livequery v:1.0.3) by hiding the logo any time an animation occurs. (Gosh, I sure hope I remembered to take that out before committing the latest batch of fixes.) Not sure why it didn't work for you.
mVChr
@mVChr - Thanks for the reply. I'll have to give it another try (for curiosity's sake, if nothing else).
patrick dw
Worked like a charm - thanks muchly...
WillyCornbread
+2  A: 

Probable cause for IE6 goofiness: hasLayout. http://www.satzansatz.de/cssd/onhavinglayout.html

Try adding zoom: 1 to the css of the images.

wombleton
I tried this and it didn't work - upvote though for the good article, I was aware of hasLayout issues but the link is a great in-depth explanation - thanks.
WillyCornbread
Aware is good, hate with a fiery passion is better.
wombleton