@Michael : Combination of fixes...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

@Michael : Combination of fixes...

Wizzud
Thought you might like to know of a slight problem I've just encountered...

If you combine the IE7 background image fix (temporary) from this post with the FF2 cursor bug fix from this post, IE7 can throw its rattle out of the pram!

It seems that with the overlay's background image removed from the css, and container set to display:none, clicking an element to activate Shadowbox can cause an error in IE7 because most of the dims are NaN.
Tracing this back, it appears that setting overlay to block might be causing IE7 to fire a window resize event, which calls resizeContent(), which in turn calls setDimensions(), which is (presumably) where the NaNs are coming from. (A lot of this is guesswork, but it seems to be borne out by the resultant restricted animation, and the stack trace in JIT). Exactly why setDimensions() should produce all these NaNs in this particular instance I don't know - if it is being triggered by setting display:block on the overlay I would have thought that the 50ms delay would have been sufficient for setDimensions() to be able to set dims up correctly ... but apparently not.

Anyway, the only way I could get around this was to insert an if(activated) test inside the window resize function, around the id = setTimout(...) statement ...

if(activated){ //seems a reasonable safeguard regardless of IE7's crankiness!
            id = setTimeout(function(){
                if(ltIE7) fixHeight();
                resizeContent();
            }, 50);
}

(Actually it could probably have gone inside the timeout function but I didn't try that!)

Obviously I don't know if the same thing would still happen once a full fix for IE7 was implemented (reversion to v1 technique?) but I did find that even a temporary fix of setting just the background color of the overlay (instead of using an image) still produced the error.

Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: @Michael : Combination of fixes...

mjijackson
Administrator
@Wizzud: <gripe>I hate IE...all versions. I'm so glad that they're releasing yet another version sometime next year. Then we can all support 3 entirely different versions of the worst browser ever invented.</gripe> Thanks for looking into this. I think I may try reverting to the v1 way of doing things (with the transparent div container) and see if I can get FF2 on Mac to cooperate. That seems to me to be the simplest way to resolve things. If I can't get that to work, I will probably come back to this post and try and implement what you're talking about here.