I have a tree structure menu. What I am trying to achieve is to add the ‘.toggle-me’ class to the next submenu that shows up.
I have achieved this to some degree, although I need to some get the .not(this) to include all .rtmenu‘s before this?
Here is the code I’m working with:
$('.rtmenu').live('click', function(){
$('.rtmenu:visible').not(this).addClass('toggle-me');
$('.toggle-me').toggle()
});
Please let me know if you need clarification. Much Appreciated, Thanks
I think you should try wrapping
thiswith jQuery, sincethisis not a jQuery object:Additionally, i would omit the
toggle-meclass. You could simply write: