Bug Tracker

Modify

Ticket #1347 (closed bug: invalid)

Opened 6 years ago

Last modified 14 months ago

.width() incorrect for non-displayed/hidden elements

Reported by: sidebog7 Owned by: brandon
Priority: major Milestone: 1.1.4
Component: core Version: 1.1.3
Keywords: Cc:
Blocking: Blocked by:

Description

I upgraded to the latest version of jQuery and all my .width() calls for hidden unordered lists came back incorrect. If the uls were set to visible then the correct value was returned.

Attached file with example. $('ul').width() returns same value as $(document).width() if the ul is hidden. When displayed it returns the correct value 21 (or similar).

Attachments

ulWidth.html Download (835 bytes) - added by sidebog7 6 years ago.
Example of error

Change History

Changed 6 years ago by sidebog7

Example of error

comment:1 Changed 6 years ago by sidebog7

On a further note. This appears to go wrong only on Firefox (so far).

comment:2 Changed 6 years ago by brandon

  • Owner set to brandon

comment:3 Changed 6 years ago by brandon

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

Actually the width method is getting the correct value. This is a CSS issue. For example just remove the position: absolute and the values will be the same.

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.