Side navigation
#3011 closed bug (duplicate)
Opened June 09, 2008 07:45PM UTC
Closed June 22, 2010 01:45AM UTC
Dimensions fails to return dimensions when visiblity is set to hidden
Reported by: | jdsharp | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | dimensions | Version: | 1.2.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Testing in 1.2.6 using innerWidth() on an element who's parent is visibility: hidden returns 0 in Firefox. Below are two test cases. This behavior changed in 1.2.6 with dimensions integrated into core.
http://jdsharp.us/jQuery/debug/scrollbar-1.2.6.html
http://jdsharp.us/jQuery/debug/scrollbar-1.2.3-dimensions.html
I isolated the issue to how width/height calculations are different from 1.2.3+dimensions to 1.2.6. In the dimensions plugin element.clientWidth is read if the element isn't visible. In 1.2.6 the element is "shown" temporarily, the property (offsetWidth) is read, and then hidden again. The issue is that if visibility is set for a parent element the element in question won't become "visible" by merely setting the css attributes.
I'll work on a patch and see what I can come up with.