Skip to content

Instantly share code, notes, and snippets.

@dwlince
Last active July 10, 2019 14:05
Show Gist options
  • Save dwlince/837ef87e6fd546d16e2fc69ce5f05740 to your computer and use it in GitHub Desktop.
Save dwlince/837ef87e6fd546d16e2fc69ce5f05740 to your computer and use it in GitHub Desktop.
js inicialización de Objeto
var _class_obj = {
variable:'asignar valor default',
init: function(args) {
this.valueInit();
this.cacheDom();
this.initEvento();
this.bindEvento();
},
valueInit: function() {
this.variable = valor;
},
cacheDom: function(id) {
this.$ejemplo = $("#IDEjemplo");
},
initEvento: function() {},
bindEvento: function() {
this.$ejemplo.on("scroll", this._onEvent_ScrollWindows.bind(this));
this.$ejemplo.on("click", this._onEvent_ClickWindows.bind(this));
},
_onEvent_ScrollWindows:function(){},
__onEvent_ClickWindows:function(){}
};
$(document).ready(function(){
_class_obj.init(args);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment