Skip to content

Instantly share code, notes, and snippets.

@JDMcKinstry
Created February 27, 2012 22:59
Show Gist options
  • Save JDMcKinstry/1927741 to your computer and use it in GitHub Desktop.
Save JDMcKinstry/1927741 to your computer and use it in GitHub Desktop.
(function($) {
if ( !$.cursorWait ) {
$.extend({
cursorWait: function(bool_value) { // this boolean value can now be set to gives us more functionality to this call
switch (bool_value) {
case true: // if set to true then we do want it to make waiting icon
document.body.style.cursor = 'wait';
break;
case false: // if set to false then we want it to have default style
document.body.style.cursor = 'default';
break;
default: // despite the name of this case, we are going on relation to the function name, thus this will be the same as case true
document.body.style.cursor = 'wait';
};
}
});
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment