Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4257 closed bug (fixed)

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?

Change History (5)

comment:1 Changed 10 years ago by trullock

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

comment:2 Changed 10 years ago by 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.

comment:3 in reply to:  2 Changed 10 years ago by trullock

Replying to 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 :)

comment:4 Changed 10 years ago by dmethvin

Resolution: fixed
Status: newclosed

Docs are updated, thanks!

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

comment:5 Changed 10 years ago by trullock

nice :)

Note: See TracTickets for help on using tickets.