SWFObject Firefox 3 jQuery Dimensions Challenge!

4 views
Skip to first unread message

Shawn

unread,
Sep 15, 2008, 3:09:37 PM9/15/08
to SWFObject
I have a problem where jQuery Dimensions miscalculates in Firefox 3
(only!) when combined with SWFObject. The main sample page is at
http://debug.i2ilabs.com/

This page uses the following scripts:
SWFObject v2.1 (http://code.google.com/p/swfobject/)
jQuery 1.1.2 (http://jquery.com/)
jQuery UI 1.6b (http://ui.jquery.com/home)
jQuery Dimensions 1.1.2 (http://plugins.jquery.com/project/dimensions)

In http://debug.i2ilabs.com/, the scrollbox slider and handle
positions are miscalculated in Firefox 3. The script that constructs
the slider and handle is scrollbox.js.

Here are a couple other test scenarios.

http://debug.i2ilabs.com/noswfobject/
This does not use SWFObject and calculates/renders correctly.

http://debug.i2ilabs.com/alert/
Here an alert box is called immediately before the loop that
calculates the dimensions (scrollbox_alert.js). After clicking "OK",
the calculation/rendering is correct. The same thing happens when a
Firebug breakpoint is set here instead of an alert.

Any ideas of what is happening here, why it only breaks in Firefox 3,
and how to fix? I'm not sure if it's a Firefox, SWFObject or jQuery
bug.

Bobby

unread,
Sep 16, 2008, 5:21:30 AM9/16/08
to SWFObject
2 things you could take a look at:
- SWFObject replaces your entire alternative content, including the
HTML container element for Flash content, so you might want to use an
extra container element to ensure that the calculations stay correct
- I am not sure how the dimensions script exactly works, but I can
imagine that the order of execution is important, e.g. an event is
triggered to recalculate the layout after your Flash content has been
embedded (the extra container element should avoid this too)

Shawn

unread,
Sep 18, 2008, 12:44:23 AM9/18/08
to SWFObject
You the man, Bobby!

Thanks a lot for the quick reply and tips!

I added the container elements as you suggested and now Firefox 3 is
calculating correctly.

Results are on http://debug.i2ilabs.com/ with container elements <div
class="bobby">

Shawn

Shawn

unread,
Sep 18, 2008, 12:48:56 AM9/18/08
to SWFObject
Quick note for other folks running into similar issues: it was
necessary to set heights on the container elements.


On Sep 18, 12:44 am, Shawn <shawn...@gmail.com> wrote:
> You the man, Bobby!
>
> Thanks a lot for the quick reply and tips!
>
> I added the container elements as you suggested and now Firefox 3 is
> calculating correctly.
>
> Results are onhttp://debug.i2ilabs.com/with container elements <div
Reply all
Reply to author
Forward
0 new messages