Skip to main content

Bug Tracker

Side navigation

#4257 closed bug (fixed)

Opened February 26, 2009 02:58PM UTC

Closed March 01, 2009 11:44PM UTC

Last modified March 02, 2009 03:19PM UTC

offet().top is returning a decimal, Docs say it returns integers

Reported by: trullock Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: offset Cc:
Blocked by: Blocking:
Description

Somehow I've managed to get $(elem).offset().top to return a decimal in FF 3.0.6.

The documentation says it returns integers, which is clearly not true!

p.s. How is it possible to have an offset of a fraction? Is this a bug in FF or JQ?

Attachments (0)
Change History (5)

Changed February 26, 2009 03:14PM UTC by trullock comment:1

Update: I can recreate fraction offsets by using ems for elements heights above the element im calling offset() on

Changed February 27, 2009 12:33AM UTC by dmethvin comment:2

This is a result of fixing #3742; browsers sometimes do return non-integer values that they round for display and positioning. I'm thinking the documentation needs to be updated to document this case.

Changed February 27, 2009 09:38AM UTC by trullock comment:3

Replying to [comment:2 dmethvin]:

This is a result of fixing #3742; browsers sometimes do return non-integer values that they round for display and positioning. I'm thinking the documentation needs to be updated to document this case.

I suspected as much, it would be worth updating the docs then :)

Changed March 01, 2009 11:44PM UTC by dmethvin comment:4

resolution: → fixed
status: newclosed

Docs are updated, thanks!

http://docs.jquery.com/CSS/offset

Changed March 02, 2009 03:19PM UTC by trullock comment:5

nice :)