Bug Tracker


Ticket #3189 (closed bug: invalid)

Opened 6 years ago

Last modified 5 years ago

Dimensions (height() and width()) fail when dom-node not yet added to document tree.

Reported by: pwnedd Owned by: brandon
Priority: major Milestone: 1.3
Component: dimensions Version: 1.2.6
Keywords: dimensions, height, width Cc:
Blocking: Blocked by:


To reproduce:

var x = $("<span></span>").css('height', 250); x.height(); 0 x.css("height"); 250px

This is a similar issue to bug #3011.

Change History

comment:1 Changed 5 years ago by brandon

  • Status changed from new to closed
  • Resolution set to invalid

height is a calculated value and a node that doesn't live in the dom doesn't technically have a height

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.