Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Created January 22, 2012 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Takazudo/1655711 to your computer and use it in GitHub Desktop.
Save Takazudo/1655711 to your computer and use it in GitHub Desktop.
$.widget('mod.hoge', {
_create: function(){
alert('this method will be called first');
this.method1();
this.method2();
this.method3();
},
method1: function(){
...
},
method2: function(){
...
},
method3: function(){
...
}
});
// do it
$(function(){
$('.mod-hoge').hoge(); // apply hoge widget, baby!
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment