11 – YUI 3.5 Javascript events basics

How to intercepts events, such as mouse clicks.

index.html

[crayon language="html"]
< !doctype html>



YUI Events






[/crayon]

events.js

[crayon language="javascript"]
YUI().use(‘event’, function (Y) {
var but1 = Y.one(“.button”);
var sub = but1.on(“mouseup”, function (event) {
alert(‘clicked! ‘ + event.target.get(‘id’));
});
//…
sub.detach();
});
[/crayon]

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>