Accessible Loading Indicator With jQuery - hg-loading

File Size: 6.61 KB
Views Total: 1571
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Accessible Loading Indicator With jQuery - hg-loading

hg-loading is a simple jQuery loader plugin which displays a customizable loading spinner when waiting for something to be loaded in the document. With appropriate ARIA roles for accessibility.

How to use it:

1. To get started, include the hg-loading plugin after jQuery.

<script src="" 
<script src="assets/js/loader.js"></script>

2. Show the loading indicator.


3. Apply fadeIn and fadeOut animations to the loading indicator.

.hg-loading {
  background: #c1c1c1;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  opacity: 0;
  transition: opacity .2s;

  opacity: 1;
  transition: opacity .2s;

.loading-body {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 75px;
  height: 75px;
  margin-left: -35px;
  margin-top: -35px;

4. Hide the loading indicator.


5. Override the default loading spinner.

  imgLoading: '/path/to/loading.svg'

6. More configuration options with default values.


  // body html
  body: "",

  // loading class
  loadingClass: "fade",

  // dialog class
  loadingDialogClass: ""

7. Available callback functions.


  // fired after the Loading was created
  onCreate: null, 

  // fired after the Loading was disposed
  onDispose: null


This awesome jQuery plugin is developed by heldergonzaga. For more Advanced Usages, please check the demo page or visit the official website.