This project is read-only.

Thickbox and Flexbox issue

Aug 17, 2009 at 1:29 PM


I'm trying to have this flexbox in a page which is called inside a thickbox (inside an iframe). once the thickbox opens I get the following error in an alert:

$(document.createElement("div")).attr("id", $div.attr("id") + "_ctr").css("width", $input.outerWidth() + arrowWidth - 2 + "px") is undefined

when the alert is closed the flexbox is there but without any values in it.

but when I call the page directly without the thickbox, the flexbox works normally.

any ideas what might be going wrong?


Sep 25, 2009 at 4:50 PM

I was receiving the same errors.

I believe the problem is when you are trying to initialize Flexbox on a div that is hidden within a parent div (I would assume your "thinkbox") is initially "hidden").  The outerWidth() function WORKS on a hidden div, but not when the div is hidden by a parent object.  Read here:

What I did was hide my parent div AFTER initializing my Flexbox.  It's not optimal (the user sees the screen before I want them to), but it works for now.  I could probably do something where I initialize the Flexbox when the div is actually "supposed" to display, but then I would want to write some code than knows when the form initially displayed rather than subsequent displays so that I wasn't constantly initializing the Flexbox (actually, maybe repeat initiallizations wouldn't bee tooo expensive?).

Anyway, hopefully this answers your question...