Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function(){
- siteName.init(page_name);
- siteName.pageLoad();
- });
- var siteName = function() {
- var site_methods = {
- home: function() {
- }
- };
- var accordion = function () {
- // Check http://css-tricks.com/how-do-you-structure-javascript-the-module-pattern-edition/
- return {
- init: function(el) {
- this.setHeights();
- this.bindUIActions();
- }
- bindUIActions: function() {
- }
- };
- }();
- var siteWide = {
- init: function() {
- this.someMethod();
- },
- someMethod: function() {
- }
- }
- return {
- init: function(page_name) {
- current_page_name = page_name;
- },
- pageLoad: function() {
- method_name = current_page_name.replace(/-/g, '_').toLowerCase();
- if (site_methods.hasOwnProperty(method_name)) {
- site_methods[method_name]();
- } else {
- // No method set up for this page
- // alert(method_name);
- }
- // Run sitewide functions
- siteWide.init();
- }
- }
- }();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement