jQuery Loading Overlay Plugin Example

Javascript:

$('.add-loading').click(function () {
  target.loadingOverlay();
});
$('.remove-loading').click(function () {
  target.loadingOverlay('remove');
});
        

HTML without overlay:

<div id="target"></div>

HTML with overlay:

<div id="target" class="loading">
  <div class="loading-overlay">
    <p class="loading-spinner">
      <span class="loading-icon"></span>
      <span class="loading-text">loading</span>
    </p>
  </div>
</div>