Lightweight jQuery AJAX Loading Spinner Plugin ajax loading js - Download Lightweight jQuery AJAX Loading Spinner Plugin - ajax-loading.js

Download Lightweight jQuery AJAX Loading Spinner Plugin – ajax-loading.js

Posted on

This time I will share jQuery Plugin and tutorial about Lightweight jQuery AJAX Loading Spinner Plugin – ajax-loading.js, hope it will help you in programming stack.

Lightweight jQuery AJAX Loading Spinner Plugin ajax loading js - Download Lightweight jQuery AJAX Loading Spinner Plugin - ajax-loading.js
File Size: 9.51 KB
Views Total: 15853
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

ajax-loading.js is a simple, lightweight jQuery plugin that automatically listens for AJAX events and displays a GIF based loading spinner while waiting for AJAX content to be loaded.

How to use it:

1. Add jQuery library and the jQuery ajax-loading.js plugin to your web pages.

1 <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
2 <script src="ajax-loading.js"></script>

2. Initialize the plugin with default options.

1 var loading = $.loading();

3. Start an AJAX loading animation.

1 loading.open();

4. Start an AJAX loading animation that will auto dismiss after 3000ms.

1 loading.open(3000);

5. Close the AJAX loading animation manually.

1 loading.close();

6. Enable or disable listening for ajax events.

1 loading.ajax(true);//enable
2 loading.ajax(false);//disable

7. Full customization options.

01 ajax       : true,
02  
03 // CSS id for the AJAX loading animation
04 id         : 'ajaxLoading',
05  
06 // CSS z-inde
07 zIndex     : '1000',
08  
09 // background color
10 background : 'rgba(0, 0, 0, 0.7)',
11  
12 // minimum duration
13 minTime    : 200,
14  
15 // CSS styles
16 radius     : '4px',
17 width      : '85px',
18 height     : '85px',
19  
20 // loading spinner
21 imgPath    : 'ajax-loading.gif',
22 imgWidth   : '45px',
23 imgHeight  : '45px',
24  
25 // loading text
26 tip        : 'loading...',
27 fontSize   : '14px',
28 fontColor  : '#fff'

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

source : jqueryscript.net