I discovered, by accident, a somewhat unusual case (which happened quite naturally in my app, of course!) where the
offset() function is incorrectly reporting values. Specifically it's including scroll positioning in the values in a way that it shouldn't.
See this jsbin link: http://jsbin.com/unuyef/1/
If you click on the green area while the frame is scrolled the top and left, you get (0,0) like you expect. But once you start to scroll the frame either down or right, and click the green box, the offset top and left become more and more negative.
If you look at the CSS part, and remove either the
overflow:auto or the
height:100% that's set on the
#p1 element, then
offset() starts working as expected, meaning it always returns (0,0) regardless of scroll position.
I'm not sure WHY that's the case, just that's what I've narrowed it down to.
I've tested this in FF24, Chrome 30, and Saf 6.0.5, all on mac.
BTW, I found a number of other bugs which *could* make my report a duplicate, but none of them showed the same cause/symptom combination I'm seeing and showing in my test case, so I figured if nothing else, my test case is helpful extra info.
It's quite possible there's an underlying bug common across them and mine is just another variation of those other reports.