Jquery - Firefox Having Slow .live() Hover Speeds, Chrome & Ie Are Fast
OK, so I am working on a new website. Its a social networking type website and it has a lot of jquery interactivity. Problem comes in when I try using the JQuery.live() for mouseo
Solution 1:
i'm not totally sure why firefox is slower but you can try to add a context element. Instead of binding all events to the root element you can do something like this:
$('div.clickme', $('#recent_photos')[0]).live('mouseover mouseout', function() {
...
});
Doing this minimizes the amount of traversal and the amount of events bound to the same node.
To figure out which function call is slow you can profile your code with firebug. To get useful results you have to use the uncompressed version of jQuery.
Post a Comment for "Jquery - Firefox Having Slow .live() Hover Speeds, Chrome & Ie Are Fast"