Example

// The currently running code: 
$.showLoading({name: '', allowHide: true });

How to use?

// How to show?
$.showLoading(option);
 
Params:
    option.name          --loading style / string
    option.allowHide     --click mask hide loading / boolean
    option.callback      --callback / function

 
// How to hide?
$.hideLoading();

Maybe you dont need jquery?

// use this
< script src="./dist/loading.min.js"> < /script >

// How to show?
window.showLoading(option);
 
Params:
    option.name          --loading style / string
    option.allowHide     --click mask hide loading / boolean
    option.callback      --callback / function

 
// How to hide?
window.hideLoading();