Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop after n seconds? #39

Closed
ghost opened this issue Aug 27, 2015 · 3 comments
Closed

Stop after n seconds? #39

ghost opened this issue Aug 27, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 27, 2015

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
Copy link

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
Copy link
Owner

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

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

@TimSmith714
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants