Bug Tracker

Ticket #1347 (closed bug: invalid)

Opened 1 year ago

Last modified 1 year ago

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

Reported by: sidebog7 Assigned to: brandon
Type: bug Priority: major
Milestone: 1.1.4 Component: core
Version: 1.1.3 Keywords:
Cc: Needs: Review

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 (0.8 kB) - added by sidebog7 1 year ago.
Example of error

Change History

Changed 1 year ago by sidebog7

Example of error

Changed 1 year ago by sidebog7

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

Changed 1 year ago by brandon

  • owner set to brandon

Changed 1 year 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.

Note: See TracTickets for help on using tickets.