Created
December 31, 2014 18:48
-
-
Save alfg/273af355d505cf9a57eb to your computer and use it in GitHub Desktop.
Basic constructor pattern with jQuery support
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
;(function($) { | |
// Plugin constructor with options and methods | |
var MainPlugin = function() { | |
var _self = this; | |
var _options = { | |
foo: "bar" | |
}; | |
this.methods = { | |
init: function () { | |
// Loads foundation jquery plugins | |
$(document).foundation(); | |
// Load slick carousel plugin | |
$('.banners').slick({ | |
dots: true | |
}); | |
}, | |
} | |
// Initialize | |
_self.methods.init(); | |
}; | |
// Load plugin on document ready | |
$(document).ready(new MainPlugin()); | |
})($); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment