John,
I have no access to all the code, at least not yet, some part of it is
also packed and minified and not part of jQuery. So there may be
something wrong there. They don't make great use of jQuery that's for
sure, they where trying to spice up a bit the ugly interface they had.

The problem is they did it before with 1.2.6 with no problem using the
bind() method. Now, somebody suggested them delegation was far
superior for their task so they tried with live() in jQuery 1.3.1 and
they fall in the problem I described.

I checked the page they showed with FF Tidy validator and it showed no
problems in the HTML. There is basically nothing except hundreds of
UL / LI / A, more or less like this:

<ul>
  <li><a href="#main">First Level A</a>
    <ul>
      <li><a href="#main">Second Level A</a>
        <ul>
          <li><a href="#main">Third Level A1</a>
          <li><a href="#main">Third Level A2</a>
          <li><a href="#main">Third Level A3</a>
          <li><a href="#main">Third Level A4</a>
        </ul>
      </li>
    </ul>
... about a hundred of the same UL blocks....then
  <li>
</ul>

I mean this is something I set up on my machine to do some test
locally and I have no slow down problems and the hover works perfectly
even if I exaggerate with the UL / LI / A and their nesting.

The problem you cited, about probable bad markup, was it referred to
the complexity of the page or to errors like unclosed tags or the
likes ?

Don't think the complexity of the markup nesting affect live() so
much...am I missing something about it ?


Diego


On 29 Gen, 17:06, John Resig <jere...@gmail.com> wrote:
> Could you put an example up? That would certainly help to debug the
> problem (I suspect that this problem is largely markup dependent).
>
> --John
>
> On Thu, Jan 29, 2009 at 8:02 AM, Diego Perini <diego.per...@gmail.com> wrote:
>
> > 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to