요소에 마우스를 올리면 해당 요소가 부모로부터 몇 번째 위치에 있는지 알아내기

 

$('ul li').hover(function(){
    console.log($(this).index());
});
>> 2