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.
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.
4. Start an AJAX loading animation that will auto dismiss after 3000ms.
5. Close the AJAX loading animation manually.
6. Enable or disable listening for ajax events.
7. Full customization options.
10 |
background : 'rgba(0, 0, 0, 0.7)' , |
21 |
imgPath : 'ajax-loading.gif' , |
This awesome jQuery plugin is developed by toplan. For more Advanced Usages, please check the demo page or visit the official website.