On 10/28/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
Yehuda Katz schrieb:
> Nope. None at all. It was my brain stuck in Ruby mode for hashes,
> honestly.
Just avoid "end" in JS ;-)
>
> There's some other good stuff in my code that optimizes things (I
> don't define defaults for options that are only used once;
In the best case, the client doesn't have to specify any options.

I was thinking about using :nth-child(even) and :nth-child(odd) in the absence of options. What do you think?

> I use setTimeout to distinguish between synch and asynch calls).
That is a very interesting idea. You assume that your timeout is called
at the same time the animation finishes, because animations are
time-based, right?

Nope. I'm just saying: If it's synchronous, wait the same amount of time as the animation is set to run for before running the next animation (so if speed is 500, I wait 500 before running next ani).

> The only thing it *doesn't* do well is event delegation (because,
> honestly, I'm waiting to see delegation brought into the core). I was
> thinking about writing a delegate plugin while that's coming down the
> pike, but maybe you'd want to abstract your code from accordion and do so?
That is something we'd like to add in 1.1. I'm not sure how the right
way to implement event delegation looks like. Basically it just uses the
event's target property when handling the event and assigns the event
listener to some parent element. In my accordion implementation, I
assigned the listener to the definition list. On the other hand, you
could as well assign it to the document object, reducing the number of
necesary listeneres even more, but producing more events...

I would think that you'd be able to do something like:
$("container").delegate("click", {child1:  fn, child2: fn2}) or something roughly like that. When the container is clicked, it would then look up the element node in the hash table and run the appropriate click (making sure that "this" inside the delegated functions points to even.target).

--
Jörn Zaefferer

http://bassistance.de


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/



--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to