Created
November 4, 2011 10:25
-
-
Save tvandervossen/1339061 to your computer and use it in GitHub Desktop.
Callback or custom event?
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
Hey, I’m playing around with a multitouch gesture recognition API | |
for Mobile Safari. Now I’m wondering; would you prefer to define the | |
event handler in a callback, like this: | |
recognize.tap(element, function() { | |
log('Tapped'); | |
}); | |
Or would you prefer the recognizer to fire a custom event, like this: | |
recognize.tap(element); | |
element.bind('tap', function() { | |
log('Tapped'); | |
}); | |
Which one do you like best? Why? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mislav I’m familiar with Zepto but for anything but trivial multitouch support you can’t get away from having to define gesture recognizers.