Skip to content

Instantly share code, notes, and snippets.

@gladiatorAsh
Created June 18, 2015 10:43
Show Gist options
  • Save gladiatorAsh/30a2bd134619c4022201 to your computer and use it in GitHub Desktop.
Save gladiatorAsh/30a2bd134619c4022201 to your computer and use it in GitHub Desktop.
var Spin = {
spinner: {},
startSpin: function (option) {
var settings = $.extend({
element: 'formBody'
}, option);
var target = document.getElementById(settings.element);
var spinner = new Spinner().spin(target);
this.spinner = spinner;
},
stopSpin: function () {
if (typeof (this.spinner) != "undefined" && this.spinner !== null && typeof (this.spinner.opts) == "object") {
this.spinner.stop();
}
}
};
@gladiatorAsh
Copy link
Author

Created methods to use spin.js more effectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment