loktar00/JQuery-Snowfall

Stop after n seconds?

Opened this issue · 3 comments

Hi,

Would it be possible to add an API to stop the snowfall after n seconds?

I'd like to show them for e. g. 5 seconds but then stop, ideally with a fade out event but more importantly so just to have it stop after n seconds.

Could you use SetInterval with $('#element').snowfall('clear'); ?
var stopSnow = window.setInterval($('#element').snowfall('clear'), 500);
Have to admit I haven't tried but this is what I've done on a few occaisions.

👍 What @TimSmith714 said is the direction I would go. I would probably use a setTimeout like so

setTimeout(function(){ $('#element').snowfall('clear');}, 5000);

Of course, much better. Kicking myself now :-)