slidetoggle - jQuery slideUp toggle close last div -


i've got http://jsfiddle.net/jv4ae32j/ toggle script working way want apart 1 thing want yo close div when last title clicked

    $('.toggle').click(function(){       $('aside').slideup();       $(this).find('aside').slidetoggle();       e.stopimmediatepropagation();     }); 

$('aside') target elements classde. need filter out aside inside clicked element.like this:

$('.toggle').click(function(){     $('aside').not($(this).find('aside')).slideup();     $(this).find('aside').slidetoggle();     e.stopimmediatepropagation(); }); 

working demo


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -