I have been using this method for a long time to set events for entire classes (for buttons etc):
$("div.bigButton").mouseover(function() { this.style.backgroundColor = '#dfdfdf'; });
However while doing some testing I have just noticed that when moving the mouse over these objects, the function fires 3 times! This is unnoticable when changing something like backgroundColor, but if I add an alert it's very obvious.
Any ideas what I'm doing wrong? I am concerned this may have an impact on performance later on.
Thanks
EDIT: Sorry, missing "style" off was a typo
The HTML is:
<div class="bigButton">
Test</div>