Somethinghitme

My Code, demos and ideas.

jQuery Snowfall 1.5 update now with snow buildup!

Thursday, Oct 6, 2011

Check out the new version here, with the ability to add images to snowflakes!

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

Added snow buildup to the plugin, so now you can pass a jquery selector in the collection option and the snow will collect on top of all the elements matched. It uses the canvas tag so the snow wont collect in IE8 or lower. To enable collection you can do the following

snowfall({collection : 'element'});

Element can be either a class or id or a list such as

$(document).snowfall({collection : '.elements'}); 
$(document).snowfall({collection : '#element'}); 

Thats pretty much it for new options below is the standard way of using the plugin.

Invoking the snow

$(document).snowfall(); 
$('#elementid').snowfall({flakeCount : 100, maxSpeed : 10});
$('.class').snowfall({flakeCount : 100, maxSpeed : 10});

Snowfall Methods

// stopping the snow 
$(document).snowfall('clear');
$('#elementid').snowfall('clear');
$('.class').snowfall('clear');

Options currently supported with default values

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 
};