live() slowing down DOM access after each firing

live() slowing down DOM access after each firing


I have just gone through a problem in code that seems related to live
().
A coworker has just shifted from bind() to live() in a page where many
UL / LI / A (probably a hundred of them).
The anchors are just internal page jumps, there are counters for each
click on them. The user have to follow a specific path through them
and get a score.
The event types for which he did the change are only "mouseover" and
"mouseout", also he will need to do the same for "click"s, he just
stopped when he saw that a few seconds interaction with that page will
slow down his processing.
I looked at the code and suggested to put the minimum necessary in the
live() callbacks, we finished up testing with this bare minimum:
$('ul li a').live('mouseover', function (e) {
e.target.style.backgroundColor = 'red';
});
$('ul li a').live('mouseout', function (e) {
e.target.style.backgroundColor = '';
});
the hover effect still works as expected on all the links but the
problem still happen in the main code, it is not visible initially
since the slow down is increasing few hundreds milliseconds for each
triggering of the events,
after a minute interacting the browser spit the warning "The script is
taking to much time....".
He does not have the same trouble with bind() at least the problem
does not show up.
Are there quirks or suggestion in how to better isolate and debug the
problem in live() ?
Diego