Bug Tracker

Opened 10 years ago

Closed 10 years ago

#12381 closed bug (worksforme)

,offset() may rerturn non integer values

Reported by: Alex_ironsys Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:

Description

.offset() method may return non integer values (foo.5) (found for Firefox 14 and Chrome 21, while both IE9 and Opera 10.51 work OK and return integer values) if called on element centered using margin auto, when both left and right margins sum is a not even number.

This is jsFiddle example:

http://jsfiddle.net/Alex_ironsys/7TGpQ/

All versions of jQuery including 1.8.0 seem to act the same.

Change History (1)

comment:1 Changed 10 years ago by dmethvin

Resolution: worksforme
Status: newclosed

This looks right to me, I don't think jQuery should be trying to change the numbers the browser returns. If you want whole pixels you can round or truncate.

http://ejohn.org/blog/sub-pixel-problems-in-css/

http://www.simonbattersby.com/blog/browsers-and-fractional-pixels/

Note: See TracTickets for help on using tickets.