Skip to content

Instantly share code, notes, and snippets.

@kkkw
Created October 21, 2016 07:14
Show Gist options
  • Save kkkw/24a89ac4896bcbad3f66bbe37cf9f212 to your computer and use it in GitHub Desktop.
Save kkkw/24a89ac4896bcbad3f66bbe37cf9f212 to your computer and use it in GitHub Desktop.
(function($){
$(function(){
var Page = {
myProp:[],
selector:'#foo',
init: function(){
this.myProp = [1,2,3];
this.bindFoo();
return this;
},
bindFoo:function(){
$(this.selector).on('click',function(){
//todo something;
});
},
render:function(){
$(this.selector).trigger('click');
},
};
Page.init().render();
});
}(window.jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment