Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#7885 closed bug (fixed)

jQuery .offset doesn't property works when current offset is float (which is possible in FireFox)

Reported by: acc15 Owned by:
Priority: low Milestone: 1.6
Component: manipulation Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:


Applies to

FireFox 3.6.13

How to reproduce

  1. jQuery 1.4.4
  2. FireFox 3.6.13
  3. Open test page

Test page:

<script type="text/javascript" src="jquery-1.4.4.js"></script>
	<div id="test" style="position:ablosute;background-color:blue;left:10.7432222px;top:10.532325px;width:100px;height:100px;">TEST</div>
	<script type="text/javascript">
		$(document).ready(function() {
			var expected = {left:100,top:100};
			var actual = $('#test').offset();
			alert(expected.left == actual.left && expected.top == actual.top ? 'bug has been fixed' : 'bug still remains, expected [' + expected.left + '; ' + expected.top + 
				'], actual [' + actual.left + '; ' + actual.top + ']');




Change History (7)

comment:1 Changed 12 years ago by acc15

comment:2 Changed 12 years ago by addyosmani

A slightly cleaner version in jsFiddle Live Test Case

comment:3 Changed 12 years ago by snover

Resolution: patchwelcome
Status: newclosed

Related to 7730.

If Firefox decides to mangle the offset values there isn’t a lot that can be done. In any case, it’s not something that we are probably going to spend time on. Feel free to submit a patch that works consistently across all browsers without causing trouble with devices that support sub-pixel precision and we would be happy to consider it.

comment:4 Changed 12 years ago by jitter

Component: unfiledmanipulation
Milestone: 1.6

comment:5 Changed 12 years ago by inukshuk

This is actually a great test case for #7730.

Possible patch here:


comment:6 Changed 12 years ago by john

Milestone: 1.6
Resolution: patchwelcome
Status: closedreopened

comment:7 Changed 12 years ago by john

Priority: undecidedlow
Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.