I have created a collapsible menu with stucture like:
- Parent
- Parent 2
- Parent 3
- Sub category
I have the following javascript
var config = {
over: function() { $(this).children('ul').slideDown('slow'); },
timeout: 5,
out: function() { }
}
$("ul.root-tags li").hoverIntent(config);
$('ul.root-tags').mouseout(function() {
$(this).children('li ul').each(function () {
$(this).slideUp('slow');
});
});
Basically I want to open sub categories on hover of the parent item but only collapse opened subcategories on mouseout of the entire list, not just the parent item. My current code does not do this. What changes do I need to make?
jsfiddle is here http://jsfiddle.net/zkhVC/4/