How Get Size Of Element With Hidden Parent?
1.4.4 return size of hidden element, but what about element in another hidden element? Is there any better solution then getWidth?
Solution 1:
When elements are hidden, their width may vary depending on your styling. And when a hidden element is inside another hidden element, results could vary again. However, the Jquery code is quite straightforward:
$('#foo').parent().width()
This will grab foo's parent div, then grab its width, but I can't guarantee it will get the element's unhidden natural width. Hope that helps!
Post a Comment for "How Get Size Of Element With Hidden Parent?"