Bug Tracker

Opened 5 years ago

Closed 5 years ago

#15165 closed bug (notabug)

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

Change History (3)

comment:1 Changed 5 years ago by Knecker

don't mind the syntax error.

comment:2 in reply to:  description Changed 5 years ago by Knecker

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.

comment:3 Changed 5 years ago by dmethvin

Resolution: notabug
Status: newclosed
Note: See TracTickets for help on using tickets.