I\'m programming a single-page application using the Angular framework. I\'m new to it. I\'ve read this guide to help me understand the fundamental differences between jQuer
the accepted solution by Patrick Evans doesn't take scrolling into account. i've slightly changed his jsfiddle to demonstrate this:
css: add some random height to make sure we got some space to scroll
body{height:3000px;}
js: set some scroll position
jQuery(window).scrollTop(100);
as a result the two reported values differ now: http://jsfiddle.net/sNLMe/66/
UPDATE Feb. 14 2015
there is a pull request for jqLite waiting, including its own offset method (taking care of current scroll position). have a look at the source in case you want to implement it yourself: https://github.com/angular/angular.js/pull/3799/files