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
offsetLeft = $('#bar').position().left; offsetTop = $('#bar').position().top;