Skip to content

Instantly share code, notes, and snippets.

Created September 27, 2011 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1244162 to your computer and use it in GitHub Desktop.
Save anonymous/1244162 to your computer and use it in GitHub Desktop.
base modular pattern for script.js
bizintel = {
/** Should give a brief overview of what kinda scripts are running on this site **/
init: function(){
//call function accordingly
banner.init();
new.init();
},
banner:{
config:{
},
/** Should say what it actually is doing. **/
/** Event Handling? Dom manipulation, and what not **/
init: function(){
if($('#banner').length == 0) return;
bizintel.news.init();
$('#banner').click($.proxy(this.eventHandler, this));
},
eventHandler: function(e){
this //banner obj
$(e.currentTarget) //#banner dom
this.someFunction(); //banner obj
},
someFunction: function(){
}
},
news: {
init: function(){
if ($('#news').length == 0) return;
}
}
}
$(function()a{bizintel.init();})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment