Mask the entire viewport or element with auto adjustment.
default z-index
is 30, change the z-index
if you want some covered element to be shown.
Install with component(1):
$ component install chemzqm/mask
var Mask = require('mask');
var mask = new Mask();
mask.show();
mask.hide();
Default to document.body (cover the entire viewport if body is not scrollable).
Make sure element is positioned relative
or absolute
or fixed
Enable a spin in the middle of mask.
Show overlay.
Hide overlay.
MIT