;-) No problem. I love .end().

Although, it should be noted that this snippet:
      .onclick()
         .next().toggle().end()
      .end()

does not work - .onclick() doesn't exist (yet). That's something else
that I'm working on so that you won't need to write all those annoying
function(){ ... } anymore. We'll see if I can end up doing it in a way
that doesn't cause a big complexity hit.

So yeah, for right now this is completely valid:

$("div.section")
   .find("dt")
      .addClass("section")
      .click(function(){
         $(this).next().toggle().end()
      })
   .end()
   .find("dd")
      .hide()
      .filter(":first")
         .show()
      .end()
   .end();

--John

On 8/23/07, SeViR <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> recently I have read the slides published by John Resig about his
> first Google Tech Talk:
> http://ejohn.org/blog/building-a-javascript-library/
>
> In the slide number 50 there is a little example code:
>
> $("div.section")
>     .find("dt")
>        .addClass("section")
>        .onclick()
>           .next().toogle().end()
>        .end()
>     .end()
>     .find("dd")
>        .hide()
>        .filter(":first")
>           .show()
>        .end()
>     .end();
>
> In a first moment, I thought: "ok, wait a moment, I need read this more
> slow". And later,
> I opened my mouth, and said wooowww!!!, Can I do that with jQuery??
>
> This is the first example of end() method that I can see and, now, I see
> the power of the end() method.
>
> Thanks John and the jQuery team for open our eyes with each JavaScript
> experience ;-)
>
> --
> Best Regards,
>  José Francisco Rives Lirola <sevir1ATgmail.com>
>
>  SeViR CW · Computer Design
>  http://www.sevir.org
>
>  Murcia - Spain
>
>

Reply via email to