Bug Tracker

Ticket #7618 (closed bug: wontfix)

Opened 4 years ago

Last modified 3 years ago

Get wrong dimensions of hidden elements

Reported by: fred.wuerges Owned by:
Priority: low Milestone:
Component: dimensions Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description

As informed, the new released version of jQuery (1.4.4) came with a new feature where you can return the dimensions (width, height) of invisible elements, something that was not possible in previous versions.

But to test this new feature I had a surprise. Actually it is now possible to bring the dimensions of invisible elements, but unfortunately the value has wrong!

You can check the link below the test:  http://jsfiddle.net/VERw5/10/

First, that IE does not return value. Second, the value it returns is the percentage of the width, and not the actual width of the element.

Change History

comment:1 Changed 4 years ago by jitter

  • Priority changed from undecided to high
  • Status changed from new to open
  • Component changed from unfiled to dimensions
  • Milestone changed from 1.5 to 1.4.5

Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a testcase!

 adapted test case

Some results off browsers on this test:

  • Opera 10.63
    • returns wrong values on first test (20px off)
    • throws exception on second test (see also #7608)
  • FF 3.6.12:
    • returns wrong values on first test (20px off)
    • shows the defined value -> 95 instead off the calculated one -> 190
  • Chrome:
    • returns wrong values on first test (20px off)
    • shows the defined value -> 95 instead off the calculated one -> 190

comment:2 Changed 4 years ago by jitter

  • Priority changed from high to low
  • Milestone changed from 1.4.5 to 1.next

Also check the comments on #7693 which is directly related. Especially the open question if innerHeight/Width, outerHeight/Width(true/false) support hidden elements at all (as jQuery nowhere claims to do so).

comment:3 Changed 4 years ago by jitter

#7732 is a duplicate of this ticket.

comment:4 Changed 4 years ago by jitter

#7781 is a duplicate of this ticket.

comment:5 Changed 4 years ago by fred.wuerges

When is it expected to fix this bug? It will be released in 1.4.5?

comment:6 Changed 4 years ago by snover

There is no timeline on this bug. It is not scheduled for a release.

comment:7 Changed 4 years ago by rwaldron

#7693 is a duplicate of this ticket.

comment:8 Changed 4 years ago by dan@…

I made another jsFiddle test case here

 http://jsfiddle.net/yt3fq/19/

comment:9 Changed 4 years ago by dan@…

I made another jsFiddle test case here

 http://jsfiddle.net/yt3fq/19/

comment:10 Changed 4 years ago by jitter

#7983 is a duplicate of this ticket.

comment:11 Changed 4 years ago by andrewstaffell@…

hello. I'm having trouble working out whether this is considered a bug which needs to be fixed, or not...

it does seem inconsistent and unhelpful that when an element (or its parent) is hidden, outerWidth() grabs the basic width but doesn't add on the border or margin, even if asked to. surely (given that it's so easy to calculate manually) this could be remedied without too much trouble, and the function would then behave consistently.

I've made another jsfiddle to demonstrate this:  http://jsfiddle.net/fewerflatlands/c2Ugu/2/

comment:12 Changed 4 years ago by john

  • Status changed from open to closed
  • Resolution set to wontfix
  • Milestone 1.6 deleted

The case here is not one that we support - you're doing the tests on an element that's inside of an element that's display: none - the element itself isn't display: none (which is a different case and one that we support).

comment:13 Changed 3 years ago by dmethvin

#9417 is a duplicate of this ticket.

comment:14 Changed 3 years ago by timmywil

#10401 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.