Created
September 1, 2010 03:40
-
-
Save miraglia/560187 to your computer and use it in GitHub Desktop.
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
//get an element reference, add a click handler | |
Y.one('#demo').on('click', function(e) {/*handle click*/}); | |
//add content to an element | |
Y.one('#demo').append(" Additional content added to #demo."); | |
//listen for any click on any <li> that descends from #demo: | |
Y.one('#demo').delegate('click', function(e) {/*handle clidk*/}, 'li'); | |
//move #demo to the location of any click on the document | |
Y.one('document').on('click', function(e) { | |
Y.one('#demo').setXY([e.pageX, e.pageY]); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment