I just checked in a new version of behavior (only works with the
latest jQuery Rev 1845+). The API is a little different now.

$().behavior() can be called in two different ways now. One is to pass
an event (like click, mouseover, etc) and a function. The other way is
to just pass a function.

$().unbehavior can be called in 4 different ways. The first two are
identical to how you would call $().behavior() and will remove the
specific behavior. A third way to call it is to only pass the event
and all behaviors for that event will be removed. The fourth way to
call it is to pass nothing and all behaviors for the particular
selector and context will be removed. (most of this is untested still
:)

You can see it here: http://brandon.jquery.com/plugins/behavior/test/test.html

--
Brandon Aaron

On 5/1/07, Mike Alsup <[EMAIL PROTECTED]> wrote:

Brandon, I think that's a wise decision for the short-term, but
long-term I really believe this is a feature for core.  Paraphrasing
Dave, jQuery is all about trying to read your mind.  What you've done
here is put that notion on steroids.  I've been playing around with
your plugin and it's really impressive.  I can't imagine a more
significant and worthwhile addition to core than this behavior code.

Mike


> Thanks Mike! My vote is to expose the selector and context on the
> jQuery object as properties and leave this as an "official" plugin ...
> at least for now.

Reply via email to