I am writing a site using jquery that repeatedly calls $(window).width() and $(window).height() to position and size elements based on the viewport size.
In troubleshooting I discovered that I am getting slightly different viewport size reports in repeated …
I have an element and need it's width without(!) vertical scrollbar.
Firebug tells me body width is 1280px.
Either of these work fine in Firefox:
console.log($('.element').outerWidth() );
console.log($('.element').outerWidth(true) );
$detour = $('.child-of-element').offsetParent();
…
It seems like in jQuery when an element is not visible width() returns 0. Makes sense, but I need to get the width of a table in order to set the width of the parent before I show the parent.
As …