Skip to main content

Bug Tracker

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:

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.

Attachments (0)
Change History (4)

Changed June 10, 2008 06:03PM UTC by jdsharp comment:1

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.

Changed June 10, 2008 07:32PM UTC by flesler comment:2

component: coredimensions
owner: → brandon

Changed April 22, 2009 05:35AM UTC by brandon comment:3

owner: brandon

Changed June 22, 2010 01:45AM UTC by dmethvin comment:4

resolution: → duplicate
status: newclosed

Dup of #4541 which has more discussion.