Skip to main content

Bug Tracker

Side navigation

#15165 closed bug (notabug)

Opened June 24, 2014 10:35AM UTC

Closed June 24, 2014 01:52PM UTC

jQuery .offset().top wrong on refresh of page

Reported by: Knecker Owned by:
Priority: high Milestone: None
Component: offset Version: 2.1.1
Keywords: Cc:
Blocked by: Blocking:
Description

When getting .offset().top from an relative positioned element, eg. div, in combination with .scroll, .offset reports wrong value once at a refresh. (Occuring in Firefox 31).

Construction Example:

$(window).scroll(function(){

var test = $("#something").offset().top);

console.log(test);

};

Related stackoverflow thread:

http://stackoverflow.com/questions/11649454/jquery-offset-wrong-on-refresh-of-page

Attachments (0)
Change History (3)

Changed June 24, 2014 10:37AM UTC by Knecker comment:1

don't mind the syntax error.

Changed June 24, 2014 10:42AM UTC by Knecker comment:2

God damn it, sorry guys.

It wasn't a jquery bug, it is a typical newbie. An element has been changed in height after $(window).load, therefore a refresh reported different offsets.

Close the ticket please.

Changed June 24, 2014 01:52PM UTC by dmethvin comment:3

resolution: → notabug
status: newclosed