jQuery loading overlay is a simple helper function wrapped as jQuery plugin for displaying loading indicator overlaid to the element where this plugin is initiated. You can download the code form github here:


code sample below will clearly describe it


this will create an overlaid element with loading image on the top of #somediv, you can display it, configure it, and hide it


jQuery loading overlay has only two methods, show and hide which is responsible to display or hide the loading overlay. When no method is passed, it will call show method implicitly.


As the method name describe what it does, show method will show loading indicator overlaid to the selected element

//this will diplay the loadng overlay on the top of #selector element

//this will have same effect on the code above


Hide method is used to hide (actually remove it ūüėÄ ) the loading overlay from the selected element.

//this will hide the loading overlay from the selected element


As mentioned above, you can configure how the loading overlay will be displayed. The default configuration is shown as below

defaultConfig = {
    //opacity level of the overlaid div
    opacity     : 0.8,

    //image used for the loading indicator
    image       : 'image/loader.gif',

    //the z-index of the overlay element
    zIndex      : 5000,

    //the loading indicator image height, to calculate the vertical center
    imageHeight : 32,

    //text to be displayed under the loading indicator image
    text        : ''

You can pass the configuration option when invoking the show method

    //your configuration here


$('#selector').loader('show', {
    //your configuration here


For user who want advanced styling to control how the loading indicator is displayed, you can add .xsanisty-loading-overlay to your css