Ticket #3037 (closed bug: wontfix)
offset returns top/left = 0 for a position: absolute / display: none div element
| Reported by: | epsilon68 | Owned by: | brandon |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.3 |
| Component: | offset | Version: | 1.2.6 |
| Keywords: | offset display none | Cc: | |
| Blocking: | Blocked by: |
Description
Offset returns a top / left = 0 for my div that is in position absolute and in display none.
this is blocking me to switch completely from Interface to jQuery-UI
I need to have the transfer between a displayed element to another one not yet visible, fade in after the transfer effect.
Many thanks in advance for your help and thanks a million for your work !!!
Cheers, Sylvain Pointeau
Attachments
Change History
Changed 5 years ago by epsilon68
-
attachment
offset.html
added
comment:1 Changed 5 years ago by epsilon68
Any feedback? someone is working on it? How can I help you?
comment:2 Changed 4 years ago by dmethvin
- Status changed from new to closed
- Resolution set to wontfix
http://docs.jquery.com/CSS/offset "The method works only with visible elements."
You could set display:block before calling offset() though.
comment:3 Changed 4 years ago by dmethvin
- Status changed from closed to reopened
- Resolution wontfix deleted
Actually, I'll reopen this and let brandon or others weigh in on whether removing this limit is practical.
comment:4 Changed 4 years ago by brandon
- Status changed from reopened to closed
- Resolution set to wontfix
Checking to see if the element is hidden is to much overhead for an already costly method. We would just be setting it's display to block (like interface was doing) before calculating offset. Just call .show().offset().
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

test case