While @nickf's answer works. If you don't care for older browsers, you can use this pure Javascript version. Works in IE9+, and others
var rect = el.getBoundingClientRect();
var position = {
top: rect.top + window.pageYOffset,
left: rect.left + window.pageXOffset
};