scottschiller / Snowstorm

Enterprise-grade JavaScript snow effect for the internets, setting CPUs on fire worldwide every winter since 2003.
http://www.schillmania.com/projects/snowstorm/
Other
538 stars 144 forks source link

snow only over one image #34

Closed skarmoutsosv closed 6 years ago

skarmoutsosv commented 6 years ago

I currently use java at http://www.skarmoutsos.gr/vaggelis.htm to have a snow effect over an image. Is it possible to have snow over one image instead of a page, using Snowstorm?

scottschiller commented 6 years ago

Sorry I missed this one over the holidays! 😅

Snowstorm can be constrained to a target element (DOM node), so it's entirely possible to have it snow only within a single <div> which could have your desired image as its only child.

The trick is to have your container element be absolute or relatively-positioned, so that snowflakes inside it can be positioned correctly.

skarmoutsosv commented 6 years ago

Once you confirmed it can be done, it was just a matter of reading http://www.schillmania.com/projects/snowstorm/#customizing to achieve the needed result. Thank you