vadimsva / waitMe

jquery plugin for easy creating loading css3/images animations
http://vadimsva.github.io/waitMe/
MIT License
328 stars 84 forks source link

Fade in, fade out, stack #16

Open talski opened 7 years ago

talski commented 7 years ago

I know that here's not the place to ask for features, but... I would like to have an option to enable fadeIn and fadeOut, and stack the requests, like if I call it two times, only hide after two hide() calls:

$('#container').waitMe();
...something...
$('#container').waitMe();
...something...
$('#container').waitMe('hide');
// do not hide yet, wait until I call it again
...something...
$('#container').waitMe('hide'); //now you can hide the loading animation
vadimsva commented 7 years ago

What is it for? When you call second time for this object $('#container') it's rerun animation, but not create new copy, after you hide it's removed.

talski commented 7 years ago

I need to use it on body, to wait multiple api calls, eg, in my app, sometimes I need to call a websocket service several times at once, like in save button, to save two different things, so I would like to have some way to control it, when the first response comes, it would wait the second response to definitely hide the animation.