bind several events and then untie a couple of them? is that right?
basically, when you hover over an element, the background color changes and then changes back when you hover over an element, but when you click on an element, I want to turn off the hover effect and change the background color to a different color, the user knows that they clicked on him. what's the best way to do this? thanks!
$('.tellmereplies').bind({click: function() { $(this).animate({'backgroundColor':'#0099ff', 'color':'#fff'}) $('.tellmereplies').unbind('mouseover','mouseout') },mouseover: function() { $(this).animate({'backgroundColor':'#fbca54', 'color':'#fff'}) },mouseout: function() { $(this).animate({'backgroundColor':'#E4E4E4', 'color':'#c0c0c3'}) } });
source share