Skip to content

Instantly share code, notes, and snippets.

@erikfloresq
Created August 28, 2013 21:43
Show Gist options
  • Save erikfloresq/6371723 to your computer and use it in GitHub Desktop.
Save erikfloresq/6371723 to your computer and use it in GitHub Desktop.
Estrutura para modulo js
var Example = (function($){
var st = {
'link' : '#example'
},
dom = {},
catchDom = function(){
dom.link = $(st.link);
},
bindEvent = function(){
dom.link.on('click',fnExample);
},
fnExample = function(){
},
init = function(){
catchDom();
bindEvent();
};
return {
init : init
};
})(jQuery);
$(function(){
Example.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment