Created
September 27, 2011 02:26
-
-
Save anonymous/1244162 to your computer and use it in GitHub Desktop.
base modular pattern for script.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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