Created
April 15, 2012 02:30
-
-
Save Yuffster/2389413 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Eve.register('myAwesomePlugin', function() { | |
| this.listen('a', 'click', function() { | |
| console.log("You clicked on a link within my namespace!"); | |
| }); | |
| //Since no namespace is provided, this event will be triggered by | |
| //any click events within the scoped namespace. | |
| this.listen('click', function() { | |
| alert("You clicked somewhere within my namespace!"); | |
| }); | |
| }); | |
| //Now, we're giving the module a scoped namespace to work with, | |
| //effectively attaching events to "#section-of-my-site" and | |
| //"#section-of-my-site a". | |
| Eve.attach('myAwesomePlugin', '#section-of-site'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment