Opened 9 years ago
Closed 9 years ago
#13457 closed bug (invalid)
Different Values for $('#foo').position().left in Firefox and Chrome
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | offset | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
<!doctype> <html> <head> <title>Test</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function (){ console.log($('#container').position().left) $(window).on('resize', function () { console.log($('#container').position().left) }) }) </script> <style> #main { position: relative; width: 100%; } #container { height: 100%; position: relative; margin: auto; width: 960px; } </style> </head> <body> <div id="main"> <div id="container">hello</div> </div> </body> </html>
Change History (6)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Component: | unfiled → offset |
---|---|
Owner: | set to mikesherov |
Priority: | undecided → low |
Status: | new → assigned |
comment:3 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 9 years ago by
Owner: | changed from mikesherov to [email protected]… |
---|---|
Status: | assigned → pending |
Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!
Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists—you may need to change this to a specific version depending on the test case.
To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to begin.
I even tried to use the test case you provided in the comments and couldn't reproduce the bug as described: http://jsbin.com/amatud/3/edit
comment:5 Changed 9 years ago by
Also, noticed you were using an invalid doctype, but even changing that to a proper one doesn't reproduce the issue.
comment:6 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
On Chrome $('#container').position().left ignores the margin on the container.
In firefox $('#container').position().left takes into account the margin.