Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11729 closed bug (patchwelcome)

height() returns wrong height on hidden elements containing floats

Reported by: fanin@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

http://jsfiddle.net/hTHQt/

When getting height() on a hidden element that contains a floating element it returns wrong height.

Change History (2)

comment:1 Changed 7 years ago by Fjandin

Seems like this is a webkit issue. I'm seeing this in chrome and safari. Firefox shows correct height. I don't have a windows machine so can't see it in explorer.

comment:2 Changed 7 years ago by dmethvin

Resolution: patchwelcome
Status: newclosed

IE9 reports 18px for both hidden and visible.

It is not a good idea at all to ask for the dimensions of a hidden element. The browser must completely reflow the document with the element visible and make you wait while it does. This is probably one of the worst performance things you could do.

Since the problem occurs only in Webkit and it's not a good idea anyway, I'll mark this patchwelcome.

Note: See TracTickets for help on using tickets.