i have created a dynamic side category menu.
$(document).ready(function () {
$(' #cate_id2 > ul > #subcate_id4 > ul').hide();
$(' #cate_id2 > ul > #subcate_id4 ').hover(function () {
$(' #cate_id2 > ul > #subcate_id4 > ul').stop().slideDown('fast');
},
function () {
$(' #cate_id2 > ul > #subcate_id4 > ul').stop().slideUp('fast');
});
});
But here some <li> contains inner tags, so i want it will works as – all <li> should work without giving the id of individual <li> tag (it contains), i mean that if any <li> tag contains inner <ul> to show, than it should work on hover
here the id of the <li> (contains inner ul)—- subcate_id4
i tried it as ——
$(document).ready(function () { $(' #cate_id2 > ul').show(); });
$(document).ready(function () {
$(' #cate_id2 > ul > li:has(ul) > ul').hide();
$(' #cate_id2 > ul > li:has(ul) > ul ').hover(function () {
$(' #cate_id2 > ul > li:has(ul) > ul').stop().slideDown('fast');
},
function () {
$(' #cate_id2 > ul > li:has(ul) > ul').stop().slideUp('fast');
});
});
but didnt worked
1 Answer