Bug Tracker

Modify

Ticket #3788 (closed bug: wontfix)

Opened 4 years ago

Last modified 15 months ago

outerWidth returns 0 when parent item is hidden

Reported by: slifty Owned by: brandon
Priority: major Milestone: 1.3
Component: dimensions Version: 1.2.6
Keywords: outerWidth hidden Cc:
Blocking: Blocked by:

Description

When an item's parent has display set to none, outerWidth() returns 0. This makes the method unreliable.

e.g.

<script type="text/javascript">

$(document).ready(function() {

alert($("#test").outerWidth());

});

</script> <div style="display:none">

<div id="test" style="width:500px">You can't read me!</div>

</div>

Change History

comment:1 Changed 4 years ago by slifty

As a note -- the documentation says that outerWidth will work for items that are hidden, which is why this behavior seems unexpected.

comment:2 Changed 4 years ago by brandon

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

comment:3 Changed 4 years ago by dmethvin

I've updated the docs to clarify that the methods don't support parent-hidden elements.

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

View

Add a comment

Modify Ticket

Action
as closed
Author


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

 
Note: See TracTickets for help on using tickets.