Skip to content

Instantly share code, notes, and snippets.

@MuhammedMahdy
Created August 28, 2016 05:17
Show Gist options
  • Save MuhammedMahdy/c8e2d47e649949046ec6f9c2f3260de1 to your computer and use it in GitHub Desktop.
Save MuhammedMahdy/c8e2d47e649949046ec6f9c2f3260de1 to your computer and use it in GitHub Desktop.
jquery plugin template
;
"use strict";
(function ($) {
// the default settings
var defaults = {
};
function ZoomInput(element, options) {
var widget = this;
widget.config = $.extend(true, {}, defaults, options);
widget.element = element;
$.each(widget.config, function (key, val) {
if (typeof val === "function") {
widget.element.on(key + ".zoomInput", function (e, param) {
return val(e, widget.element, param);
});
}
});
this.init();
}
// methods
ZoomInput.prototype.init = function () {
};
// the main function
$.fn.ZoomInput = function (options) {
new ZoomInput(this, options);
return this;
};
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment