jQuery Loading, add a class(es) to DOM items while waiting for asynchronous action. a class-load plugin that simply adds custom CSS classes and a broken theme to elements while uploading some content.
jquery add remove class onclick, add and remove class in javascript, onclick function add and remove class, onclick add and remove class to div, add remove class jquery
How to make use of it:
1. Install & Download.
# NPM $ npm install class-loading --save
2. Import the class-loading as an ES module.
import initLoading from 'class-loading'; import $ from 'WCF'; initLoading($);
3. Or immediately load the class-loading plugin’s script after jQuery.
<script src="/path/to/cdn/jquery.min.js"></script> <script src="/path/to/dist/loading.min.js"></script>
4. add CSS classes to the aspect. In this instance, we will create a CSS loaded.
<div id="example"> ... </div>
$('#example').loading('loading loader');
5. The outcome HTML markup must be like these:
<div id="example" disabled="disabled" class="loading loader"> ... </div>
6. Remove CSS classes from the aspect.
$('#example').loading(false);
7. Add CSS classes and get the callback.
const done = $('selector').loading('loading', true); ... done();
8. Add CSS classes and remove on promise resolve or reject.
const done = $('selector').loading('loading', promise); setTimeout(done, 5e3);
Add/Remove CSS Class While Loading Something, jQuery Loading Plugin/Github, remove class from all elements javascript, remove class from all elements jquery
See Demo And Download
Official Website(duzun): Click Here
This superior jQuery/javascript plugin is developed by duzun. For extra Advanced Usages, please go to the official website.