I would like to know how to get the distance/offset/position of an element relative to it\'s parent element.
Unlike jQuery\'s position() functionality,
position()
This code works for me.
var child_top = $("#parent_div").scrollTop() + $("#child_div").offset().top
This should do it:
$('#pos1').offset().top - $('#pos1').parent().offset().top - $('#pos1').parent().scrollTop()
Parent.offset() - child.offset() ?
Using jQuery offset()