Most browsers cannot determine the width of an element if it is not
currently visible. That includes the case where one of the parent
elements is hidden. That makes sense when you think about it; the
layout engine doesn't know how the element would "look" unless it's
visible and interacting layout-wise with its parent and sibling
elements.

If jQuery's .width() method detects that the element you are trying to
measure has display:none, it will temporarily set the element to show
so that it can be measured. However, it does not try to apply that
rule recursively to all the parent elements up to the body. That would
be pretty time consuming.

You'll need to defer the width calculation until its parent div (tab)
is visible, or temporarily show that tab long enough to do the
calculation initially and then switch to the tab selected by the url.

I've had a similar problem to this when trying to use my splitter
plugin on one tab that isn't initially visible; the splitter needs to
know the dimensions of the parent element to initialize.

Reply via email to