Opened 13 years ago
Closed 12 years ago
#6395 closed bug (worksforme)
offset().left doesn't work properly in Opera
Reported by: | abnuk | Owned by: | abnuk |
---|---|---|---|
Priority: | undecided | Milestone: | |
Component: | manipulation | Version: | 1.4.2 |
Keywords: | opera, offset | Cc: | |
Blocked by: | Blocking: |
Description
The left position of a div is calculated improperly in Opera 10.51. Extract from the console:
$j('#id').offset().left
1307
$j('#id')[0].offsetLeft
1197
offset().top is fine. Verified with both 1.3.2 and 1.4.2 versions.
Change History (3)
comment:1 Changed 12 years ago by
Milestone: | 1.4.3 |
---|
comment:2 Changed 12 years ago by
Owner: | set to abnuk |
---|---|
Priority: | → undecided |
Status: | new → pending |
Thanks for the report, but I am not sure this is a jQuery bug. $.fn.offset
is relative to the document, whereas offsetLeft
is relative to the nearest offsetParent
. If this is still an issue in the latest version of Opera, please provide a test case demonstrating the issue.
comment:3 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | pending → closed |
Testing offset().left and [0].offsetLeft across the latest versions of Opera, Chrome, Safari and FireFox I am consistently seeing the same expected values output when reproducing your test case. Please see here Live Test Case. As snover correctly points out, both offset and offsetLeft are relative to different things and so I would recommend re-reading the documentation on both to see how they should be correctly used. Thanks!
Resetting milestone to future.