SlideDeck.io – A repository of great HTML presentations
.on(".theBubble") – Quick overview – EVENT BINDING
View Github Repository
Open presentation in a new window
fontzter
See all presentation from fontzter
.on(".theBubble") – Quick overview – EVENT BINDING
0
0
onthebubbleslides
On Github
fontzter / onthebubbleslides
.on(".theBubble")
Event Handling at a Higher Level
Dave Fontz
BOFCONF
Baltimore, MD
July 2013
Quick overview
jQuery Event Binding
Beginner/Intermediate Level
on() Event -- Best Practices
ABOUT ME
DAVE FONTZ
dfontz@dbdworks.com
@fontzter
EVENT BINDING
In a Bind
$(" .clickme ").click( myFunc );
can also be written as:
(so many ways to click!)
$(".clickme").one("click", myFunc);
$(".clickme").bind("click", myFunc);
$(".clickme").on("click", myFunc);
$(".clickme").live("click", myFunc);
$(".parent").delegate(".clickme", "click", myFunc);
$(".parent").on("click", ".clickme", myFunc);
Nesting the the Dom Tree
HierarchY - Code Example
THank you!
DAVE FONTZ
dfontz@dbdworks.com
@fontzter