Rather than setting CSS attributes directly, use classes. Eg, with hover: $('.someElements').click(function() { $('.someElements').removeClass('aSelected'); $(this).addClass('aSelected'); }
$('.someElements').hover( function(){ $(this).addClass('aHover') }, function() { $(this).removeClass('aHover'); } ); This should solve your problem. On Mar 7, 10:57 am, TheOriginalH <[EMAIL PROTECTED]> wrote: > I have a menu which is working nicely. When an item is clicked, I'm > using jQuery to change the CSS color to indicate it is current. To > keep things neat, I have also changed the color of all similar items > back to the default (otherwise ALL items would be highlighted as you > went through the menu. > > Unfortunately this has the side effect of killing the natural css > hover pseudo class :( > > I've messed with the .hover function, but the implementation I've used > then kills the coloring on click (as when you mouse away from hover, > it returns to the default). > > Anyone come across this and know how to fix it? > > TIA, > > H