I want to get the offset of an element relative to a specific parent not the direct one and not the document.
I looked for that on the internet and found the of
You can try this out:
var offsetLeft = $('#myElement').position().left - $('#myElement').closest('#crazyAncestor').position().left; var offsetTop = $('#myElement').position().top - $('#myElement').closest('#crazyAncestor').position().top;