I'm trying to use jQuery's nextUntil() but the other parent divs are closing when I click the child divs. I wanted to use the .not() before the nextUntil function.
I'm trying to achieve a correct way of hiding and showing child divs. Thanks
$('.content').click(function() {
$(this).not('.head').nextUntil('.content').toggle('slow');
$('.subcontentchild').hide();
return false;
});
You can specify multiple selectors separated by ,
:
$('.content').click(function() {
$(this).nextUntil('.content,.head').toggle('slow');
$('.subcontentchild').hide();
return false;
});
See updated fiddle
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.