My list is something like this
<div id="jqxTree">
<ul>
<li>Parent1
<ul>
child1
</ul>
</li>
<li>Parent2
<ul>
child2
</ul>
<ul>
child2.1
</ul>
</li>
</ul>
</div>
when i use jquery draggable its dragging entire list.How to i drag only child1,child2,child2.1 elements .To generalise i wanna drag only li elements inside ul which is inside li..
I tried using the below function but on mouseover the elements of li the elemnts get hidden
$('#jqxTree').delegate('li li', 'mouseover', function () {
$(this).draggable({
revert: true,
revertDuration: 0
});
});
According to jQuery API page:
Fiddle Demo
jQuery:
In CSS, use
>
between parent and child elements.Also you had
li li
instead ofli ul
.