Can jQuery perform an "if" function? As in, if a class exists in one menu item, apply that class to a different menu item? This is slightly different than the usual active page menu highlighting, as I'm dealing with active dropdown menus and child pages.
What I'd like to do is
(the usual suspect) $(document).ready(function() {
If...
$('#menu-main-menu li.menu-item-1061') "contains the classes
current-menu-ancestor current-menu-parent"
then add those same classes to, i.e.:
$('#menu-main-menu li.menu-item-1099').addClass('current-menu-ancestor
current-menu-parent')
}); });
Should be a way for this to work....