Skip to content

Instantly share code, notes, and snippets.

@joecritch
Created April 19, 2011 19:20
Show Gist options
  • Save joecritch/929349 to your computer and use it in GitHub Desktop.
Save joecritch/929349 to your computer and use it in GitHub Desktop.
$.fn.simpleScroll = function(conf) {
// already constructed --> return API (it shouldn't really be called for a second time.)
var el = this.data("simpleScroll");
if (el) { return el; }
var conf = $.extend({}, $.motionlab.simpleScroll.conf, conf);
return this.each(function() {
el = new SimpleScroll($(this), conf);
// This is the first time the plugin has been called, so we need to add the class to the data object
$(this).data("simpleScroll", el);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment