# Tutorial: Creating Falling Snow in HTML/JS

**URL:** https://forum.kirupa.com/t/tutorial-creating-falling-snow-in-html-js/326199
**Category:** web dev
**Created:** [November 29, 2011, 9:30am UTC](https://forum.kirupa.com/t/tutorial-creating-falling-snow-in-html-js/326199 "2011-11-29T09:30:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [November 29, 2011, 9:30am UTC](https://forum.kirupa.com/t/tutorial-creating-falling-snow-in-html-js/326199/1 "2011-11-29T09:30:29Z")

</div>

Hi everyone,  
This is the happening place to discuss all things related to the [Creating Falling Snow in HTML/JS](http://www.kirupa.com/html5/creating_falling_snow_in_html_js.htm) tutorial.

Cheers,  
Kirupa :te:

---

<div class="post-metadata">

### Author: ![Nightwing308](https://avatars.discourse-cdn.com/v4/letter/n/b9bd4f/32.png) [@Nightwing308](https://forum.kirupa.com/u/Nightwing308)
#### Post date: [October 14, 2014, 4:08am UTC](https://forum.kirupa.com/t/tutorial-creating-falling-snow-in-html-js/326199/2 "2014-10-14T04:08:52Z")

</div>

[QUOTE=kirupa;2628970]Setting the overflow to hidden should do the trick, but you also have a clip property as well. I need to play with both and see which does what we need.

I will add a blurb about how to do this at the bottom of the article where I discuss the modifications one can make, for that would be a common question! :P[/QUOTE]  
Hi Kirupa,  
are you still maybe planning of adding something about how to contain the snow inside of a div with specific size? I’ve created a div (with background image) on the page, and played around with the original code for several days now, but the best I can get is only a couple of snow flakes every now and then becoming visible inside the div and moving agonizingly slow, no matter how I change the number and/or speed of the snow flakes. ;(  
Any help would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [October 14, 2014, 7:08am UTC](https://forum.kirupa.com/t/tutorial-creating-falling-snow-in-html-js/326199/3 "2014-10-14T07:08:31Z")

</div>

[QUOTE=Nightwing308;2662964]Hi Kirupa,  
are you still maybe planning of adding something about how to contain the snow inside of a div with specific size? I’ve created a div (with background image) on the page, and played around with the original code for several days now, but the best I can get is only a couple of snow flakes every now and then becoming visible inside the div and moving agonizingly slow, no matter how I change the number and/or speed of the snow flakes. ;(  
Any help would be greatly appreciated.[/QUOTE]  
Unfortunately, I haven’t had a chance to do that yet!

Do you have an example of your version? I can try to take a look at it and see what can be done.

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [October 14, 2014, 8:04am UTC](https://forum.kirupa.com/t/tutorial-creating-falling-snow-in-html-js/326199/4 "2014-10-14T08:04:21Z")

</div>

I took a quick look and came up with this: [https://gist.github.com/krilnon/337a6a3442651ca2c371/revisions](https://gist.github.com/krilnon/337a6a3442651ca2c371/revisions)

It’s incomplete, but it’ll slightly constrain the flakes to the ‘#content’ div. It doesn’t look like there’s good support for many of the various `clip` CSS properties (some are mostly unimplemented, and plain `clip` is apparently on its way out), so I didn’t want to mess with that.

---

<div class="post-metadata">

### Author: ![Nightwing308](https://avatars.discourse-cdn.com/v4/letter/n/b9bd4f/32.png) [@Nightwing308](https://forum.kirupa.com/u/Nightwing308)
#### Post date: [October 14, 2014, 4:47pm UTC](https://forum.kirupa.com/t/tutorial-creating-falling-snow-in-html-js/326199/5 "2014-10-14T16:47:47Z")

</div>

[QUOTE=kirupa;2662969]Unfortunately, I haven’t had a chance to do that yet!

Do you have an example of your version? I can try to take a look at it and see what can be done.[/QUOTE]  
Well, not really because I got aggravated and deleted all the mutilated…uh, “modified” versions of the .js file.  
The test page I have uploaded here [http://www.nightwingsgraphics.com/Snowtest/snowtest.html](http://www.nightwingsgraphics.com/Snowtest/snowtest.html)  
only has the number of snow flakes changed to 150. Everything else is like it was in the original .js (I think) ☹
