How to get offset() relative to parent in jQuery?
Use the position() method.
$('#bar').position().left;
It's simple enough: get the offset of the element and substract the offset of its parent.
var elem = $("#bar");
var offset = elem.offset().left - elem.parent().offset().left;