So I have a div like:
<div class="uiGrid">
<div class="trigger"></div>
</div>
And I want to know the position of trigger to uiGrid and have tried both these:
$('.trigger').offset('.uiGrid');
$('.trigger').position('.uiGrid');
but neither get it. Offset is relative to the document and position is relative to the parent and not the specified element.
How would I do this?
Thanks
just do the subtraction your self…
var relativeY = $("elementA").offset().top - $("elementB").offset().top;