npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

class-loading

1.1.0 • Public • Published

jquery.loading

Add class(es) to DOM elements while waiting for async action. Promise or callback.

Usage

// 1. Stack multiple loaders
   $('selector').loading('loading loader-1'); // add classes
   $('selector').loading('disabled'); // add another class
   // ...
   $('selector').loading(false); // remove .disabled
   $('selector').loading(false); // remove .loading.loader-1
 
// 2. Get a callback to remove classes
   var cb = $('selector').loading('loading loader-2', true);
   // ...
   cb(); // remove added loading class
 
// 3. Wait for a Promise to resolve/reject
   $('selector').loading('loading loader-3', promise);

install

npm i class-loading

Downloadsweekly downloads

1

version

1.1.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability