Created
April 19, 2011 19:07
-
-
Save joecritch/929295 to your computer and use it in GitHub Desktop.
Part 4 - Wrapper
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
// '$.fn' is jQuery's prototype. Practically all plugins work this way. It's just that we're not really doing much directly inside of it. | |
$.fn.simpleScroll = function(conf) { | |
// If the plugin was to be matched by several elements, this part of the plugin would only run once. But see how we then loop through "this"...? | |
// (This merges the default options that we namespaced at the beginning, with any new options being passed in by the user) | |
var conf = $.extend({}, $.motionlab.simpleScroll.conf, conf); | |
// Okay, now we loop through ALL the matched elements. | |
return this.each(function() { | |
// Create a new carousel per matched element. | |
el = new SimpleScroll($(this), conf); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment