When elements are hidden, their width may vary depending on the style. And when the hidden element is inside another hidden element, the results may change again. However, jQuery code is pretty simple:
$('#foo').parent().width()
This will grab the parent div foo and then grab its width, but I cannot guarantee that it will get the invisible natural width of the element. Hope this helps!
source
share