This gives me the position of some element from the left edge of the main window:
$(\'#bar\').offset().left;
If that element is situated in
Position within a div relative to its parent:
In my case, when scroll changed the calculated offset also changed and it shouldn't so i ended up using pure javascript which is quicker anyway...
element.get(0).offsetTop
Other variation like Left is also possible element.get(0).offsetLeft
Conclusion
element.offset().top or position() are not optimal for position relative cases.