Snowfall Plugin Updated

Updated the snowfall plugin that was released yesterday with a few more features.  The primary new feature allows you to specify which elements you want the snow to appear in. An example of this can be seen below. View a full page demonstration


$('#snow-window').snowfall({flakeCount : 100, maxSpeed : 10});

In addition to snowing within elements there are some more options available, properties available are

flakeCount,
flakeColor,
flakeIndex,
minSize,
maxSize,
minSpeed,
maxSpeed

You can still initialize the plugin with

$(document).snowfall();

but the flakes will not use fixed for positioning, they will now travel down the page completely. On some long pages this will make it seem like its not “snowing” as much. Im working on a few more updates that should be released in the following days. If you end up using this I’d love to know. You can download the most recent version here.


This entry was posted in Programming, Web Development and tagged , , , . Bookmark the permalink.

16 Responses to Snowfall Plugin Updated

  1. Kim says:

    I really enjoy you.

  2. Ivan says:

    Thanks, just a little notice. In my IE8 horisontal scrolling escaped only after:
    if(this.x > (elWidth) – 40 || this.x < 40)

  3. admin says:

    ah nice, thanks. Yeah I just put an arbitrary value in there (I think 6). Ill update it to 40 and see how it performs on other browsers as well.

  4. zarvox says:

    cool! next version with wind…

  5. Anthony says:

    So let’s see.. if I wanted it to just snow for a time and then turn it off would I call snowfall again with a count of zero?

  6. Jared says:

    Very nice! How hard would it be to make it have a small transparent png falling and rotating instead of the snowflakes?

  7. admin says:

    Anthony, that wont work unfortunately, but ill update the code within the week and add a stop, or clear function.

    Jared, It wouldn’t be too hard, I just prefer the single pixels. Maybe ill update it and add an image option.

  8. Paul Noone says:

    Hiya, I’m loving this and after a couple of false starts have got it to display as expected.

    Quick question which probably applies to all jQuery plugins: if I try to initialise the plugin immediately after the plugin function I get no snow.

    I seem to have to call the initialisation either within or after the closing body tag.

  9. admin says:

    Not sure if I totally understand. Best way to initialize it is in a $(document).ready because then you know the dom has loaded best practice is to do that at the bottom of the page (within body still).

  10. Dakota says:

    Any idea how the snow could build up into a pile? Not just on the bottom of the screen but on a list of dom elements passed into the script. for example have the snow stop moving when it hits a dom element, such as a button… and then have any snow that hits that stopped snow flake stop as well…causing it to pile up?

  11. admin says:

    Dakota, I have actually considered that exact functionality. Ill work on something tomorrow in relation to it.

  12. Matt Davis says:

    What is flakeIndex for?

  13. admin says:

    I used it so I could keep crack of individual flakes.

  14. Emilia says:

    Hey, this looks awesome, but why won’t the download link work for me, is it because I’m on a Mac? (OS X) really want this effect on my website :(

  15. admin says:

    The link should work fine :? I don’t discriminate against Mac users :P .

  16. John Burns says:

    Great really like this its the best effect!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>