Skip to content

Instantly share code, notes, and snippets.

@arapehl
Created June 10, 2011 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arapehl/1019584 to your computer and use it in GitHub Desktop.
Save arapehl/1019584 to your computer and use it in GitHub Desktop.
jQuery vs. YUI 3 custom events
// jQuery
$('#foo').bind('customEvent', function () {
alert('foo');
});
$('#foo').trigger('foo');
// YUI 3
Y.on('foo', function () {
alert('foo');
}, '#foo');
Y.fire('foo');
Y.on('bar', function () {
alert('bar');
});
Y.fire('bar');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment