Created
June 12, 2012 14:19
-
-
Save yamamoto-febc/2917826 to your computer and use it in GitHub Desktop.
javascript docment3
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
$.Controller("MyWidget", | |
{ | |
defaults : { | |
targetElement : 'div' | |
} | |
}, | |
{ | |
"{targetElement} click" : function(elm, ev){ | |
console.log(elm); | |
} | |
}) ; | |
var controller1 = new MyWidget($(".selector")); //divエレメントにclickイベントがバインドされる | |
var controller2 = new MyWidget($(".selector") , {targetClassName : 'li' } );//liエレメントにバインドされる |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment