Stop after n seconds?
Opened this issue · 3 comments
Deleted user commented
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.
TimSmith714 commented
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.
loktar00 commented
👍 What @TimSmith714 said is the direction I would go. I would probably use a setTimeout like so
setTimeout(function(){ $('#element').snowfall('clear');}, 5000);
TimSmith714 commented
Of course, much better. Kicking myself now :-)