Hi, I have the following markup:
<div id="selectable1">
<span class="drag">Some Text</span>
<span class="drag">Some Text</span>
<span class="drag">Some Text and <span class="drag">Some Other Text</span></span>
</div>
I need to create a function that will get the relative position of any span (nested or not) to the main parent - #selectable1.
I have tried to use position() but my code does not work:
$(".drag").live('click',function(){
var relativepos = $('.drag').position().left
alert(relativepos);
});
Any tips? Thanx