This time I will share jQuery Plugin and tutorial about jQuery Plugin For Handling Image Loading Events – imgLoading, hope it will help you in programming stack.
imgLoading is a lightweight jQuery image loading progress handling plugin that allows you to trigger specified events based on the current status of image loading (start, progress and end).
How to use it:
1. Just include the jQuery imgLoading after loading jQuery library and we’re ready to go.
1 |
< script src = "//code.jquery.com/jquery-1.12.1.min.js" ></ script > |
2 |
< script src = "js/jquery.imgLoading-1.0.js" ></ script > |
2. Trigger an event when the image stats loading.
1 |
$( '#img-container' ).imgLoading({ |
2 |
start: function (e, data){ |
3. Trigger an event when the image is loading.
1 |
$( '#img-container' ).imgLoading({ |
2 |
progress: function (e, data){ |
4. Trigger an event when the image is completely loaded.
1 |
$( '#img-container' ).imgLoading({ |
2 |
end: function (e, data){ |
This awesome jQuery plugin is developed by GildasP. For more Advanced Usages, please check the demo page or visit the official website.