Permalink
Show file tree
Hide file tree
3 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add .delegate() and .undelegate(). An alternative to using .live() wh…
…ich goes from a single root and filters by the specified selectors. Should be used like do: .delegate(td, hover, someFn);. Fixes #6005.
- Loading branch information
Showing
2 changed files
with
433 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
31432e0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now have two ways to do event delegation in jQuery.
One uses the good old jQuery syntax we all know but seems somewhat magical before you know how event delegation works.
The other requires a good understanding of event delegation but seems much better from a performance point of view.
Is delegate already compatible with mouseenter/mouseleave, change, submit and focus/blur?
31432e0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. As you'll note, delegate just uses live - therefore it supports everything that live supports.
31432e0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!