Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#7618 closed bug (wontfix)

Get wrong dimensions of hidden elements

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

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 (14)

comment:1 Changed 13 years ago by jitter

Component: unfileddimensions
Milestone: 1.51.4.5
Priority: undecidedhigh
Status: newopen

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 13 years ago by jitter

Milestone: 1.4.51.next
Priority: highlow

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 13 years ago by jitter

#7732 is a duplicate of this ticket.

comment:4 Changed 12 years ago by jitter

#7781 is a duplicate of this ticket.

comment:5 Changed 12 years ago by fred.wuerges

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

comment:6 Changed 12 years ago by snover

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

comment:7 Changed 12 years ago by Rick Waldron

#7693 is a duplicate of this ticket.

comment:8 Changed 12 years ago by dan@…

I made another jsFiddle test case here

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

comment:9 Changed 12 years ago by dan@…

I made another jsFiddle test case here

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

comment:10 Changed 12 years ago by jitter

#7983 is a duplicate of this ticket.

comment:11 Changed 12 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 12 years ago by john

Milestone: 1.6
Resolution: wontfix
Status: openclosed

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 12 years ago by dmethvin

#9417 is a duplicate of this ticket.

comment:14 Changed 12 years ago by Timmy Willison

#10401 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.