Quick Start
The directory structure after download is as follows:
Using this plugin is straightforward, as shown in the following steps:
1, reference jquery,1.2.3 above version
<script type= "Text/javascript" src= "Jquery-1.7.1.js" ></script>
2, reference Jquery.loadmask.css, Jquery.loadmask.js (or min version jquery.loadmask.min.js)
<link href= "Jquery.loadmask.css" rel= "stylesheet" type= "text/css"/><script type= ' text/javascript ' src= ' Jquery.loadmask.min.js ' ></script>
3. Call the Mask (Label,delay) method to mask the DOM element.
$ ("#myDiv"). Mask (); $ ("#myDiv"). Mask ("Loading ..."); $ ("#myDiv"). Mask ("Loading ...", 500);
4. Call the Unmask () method to unblock.
$ ("#myDiv"). unmask ();
5. Call the Ismasked () method to determine if a DOM element is masked.
if ($ ("#myDiv"). ismasked ()) {$ ("#myDiv"). unmask ();
Method Mask ([Label] [, Delay])
Displays the load shield on the selected DOM element, supporting one or more selectors.
Defined
$.fn.mask = function (label, delay) {...}
Parameters
Label
A text string, displayed at the outermost loading prompt (on the edge of the wait picture), if this parameter value is undefined, only a shield with no wait icon and text hint is displayed;
=undefined
Delay
The time in milliseconds to delay the display, and if the unmask () method is not yet called to the delay time, then nothing will happen, that is, the display is no longer shaded.
Case
$ ("#myDiv"). Mask (); $ ("#myDiv"). Mask ("Loading ..."); $ ("#myDiv"). Mask ("Loading ...", 500);
Unmask ()
Removes the Shield layer on the DOM element, which supports one or more selector;
Defined
$.fn.unmask = function () {...}
Parameters
No
Case
$ ("#myDiv"). unmask ();
Ismasked ()
Checks if there is a shield on a DOM element, returns False if no shield or shield delay is displayed, otherwise returns true;
Defined
$.fn.ismasked = function () {...}
Parameters
No
Case
if ($ ("#myDiv"). ismasked ()) {$ ("#myDiv"). unmask ();
Jquery.loadmask.js