I'm not sure if "toggling classes" is the right way to describe what I'm having trouble with, so let me explain a little...
If you look at the example page here: http://www.cement-site.com/menutest/test2.html Here are the behaviors: 1) mousing over any of the four tabs produces a hover state 2) Clicking on any of the first three tabs produces an "on" state, displays the corresponding menu panel, and puts the other tabs in their "dimmed" state 3) Clicking on another tab when one is already "on" hides the previous panel, and correctly applies "on" and "dimmed" states Here's the bit that's not working: 4) if you toggle an exposed panel/tab, the panel hides (correct), its tab states goes back to the default (also correct), but the other three tabs are left in their "dimmed" state, rather than going back to their default state. 5) Also, if you click back and forth between tabs, the "on" state isn't getting properly toggled (bolding is lost on repeated clicks back and forth). Now, the "dimmed" tabs have a class added to them; if I change it from addClass to toggleClass this produces incorrect results when doing #3 above. I'm not sure what I need to do -- but my thought is that I need to test to see if any menu panels are visible. If none are, make sure the "navDim" class is removed from all the <h2> tags. But I'm not sure how to correctly test for this -- or even if this is the most efficient thing to do. My jQuery code is below. jQuery.fn.slideFadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); }; $(document).ready(function() { $('div#mainNav> div.navLinks').hide(); $('div#mainNav> h2').hover( function () { $(this).children().addClass('navHover'); }, function () { $(this).children().removeClass('navHover'); } ); $('div#mainNav> h2.hasMenu').click(function() { var tc = $(this).attr('class').split(' ').slice(0, 1); if ($(this).hasClass('navDim')) $(this).removeClass('navDim'); $(this).toggleClass('navSel'); if ($(this).siblings('h2').not('navDim')) $(this).siblings('h2').addClass('navDim'); var nd = $('div#mainNav> div[class*=' + tc + ']'); $(nd).slideFadeToggle('fast'); $(nd).siblings('div').hide(); return false; }); }); Thank you!