Somethinghitme

Code, demos and ideas.

Snowfall 1.6

December 08, 2012

Repo on Github Download Jquery Snowfall 1.6 View the plugin in action

You can now use images for snowflakes!

[sourcecode language=“js”] // jQuery vs $(document).snowfall({image :“images/flake.png”, minSize: 10, maxSize:32});

// purejs vs snowFall.snow(document.body, {image : “images/flake.png”, minSize: 10, maxSize:32}); [/sourcecode]

Invoking the snow

[sourcecode language=“js”] $(document).snowfall(); $(‘#elementid’).snowfall({flakeCount : 100, maxSpeed : 10}); $(‘.class’).snowfall({flakeCount : 100, maxSpeed : 10}); [/sourcecode]

Snowfall Methods

[sourcecode language=“js”] // stopping the snow $(document).snowfall(‘clear’); $(‘#elementid’).snowfall(‘clear’); $(‘.class’).snowfall(‘clear’); [/sourcecode]

Options currently supported with default values

[sourcecode language=“js”] options = { flakeCount : 35, // number flakeColor : ‘#ffffff’, // string flakeIndex: 999999, // number minSize : 1, // number maxSize : 3, // number minSpeed : 2, // number maxSpeed : 3, // number round : false, // bool shadow : false, // bool collection : ‘element’ // string }; [/sourcecode]

Example


Written by Jason Brown Father, Veteran, lover of everything tech.