A lightweight jQuery overlay mask plugin ideal for masking elements while they are loading or being updated.
jQuery-mask-o is small, weighing in at less than 0.5kb (minified & gzipped).
http://danny-mcc.github.io/jquery-mask-o/
Use the plugin as follows:
Mask an element.
var options = {
image : 'loader.gif', // Overlay image
opacity : 0.5, // Overlay opacity
color : '#FFF', // Overlay colour
zIndex : 50, // Z-index of overlay
}
$('form').masko( options );
Unmask an element.
$('form').unmasko();
You can specify the following options.
image : 'loader.gif', // Overlay image
opacity : 0.5, // Overlay opacity
color : '#FFF', // Overlay colour
zIndex : 50, // Z-index of overlay
customClass : false // Class to apply to overlay
This plugin is available under the MIT license.