Skip to content

Instantly share code, notes, and snippets.

@jinwei233
Created December 17, 2013 04:08
Show Gist options
  • Save jinwei233/7999903 to your computer and use it in GitHub Desktop.
Save jinwei233/7999903 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>kissy 自定义事件对象(Custom EventTarget) </title>
</head>
<body>
<script charset="utf-8" src="http://g.tbcdn.cn/kissy/k/1.4.0/seed.js"></script>
<script type="text/javascript">
KISSY.use("event",function(S,Event){
function Custom(id){
}
S.augment(Custom, Event.Target);
var c1 = new Custom("c1");
c1.on('start',function(){
console.log('start');
});
c1.fire("start");
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment