jSnow, is a jQuery plug-in that adds falling snow effect to your website (using javascript), a very common decorative effect that every website needs for Christmas! jSnow is lightweight (2.6kb), doesn't require any external files to run (css or images) and it's very easy to use! Besides the small footprint, jSnow offers various other unique features like:
Download jSnow v1.2 with examples! View jSnow v1.2 example!
In order jSnow to work you need the jQuery library (version 1.2+, 1.3+) and the javascript file (.js) of the jSnow! Once you have them both, link them inside the head of your html file in the following order:
don't forget to replace "folderName" with the folder that you've stored the two ".js" files.
jSnow has been is compatible with all the following browsers:
jSnow is very easy to use, all you have to do (besides the installation part, see above) is run the following command:
There is nothing wrong with the code in line 3, you don't have to declare any DOM element, jSnow works automatically. Probably in next versions, I will add support for multiples DOM elements.
For best results (for the snow to fall tothe whole width of the window/page) you must ensure in your CSS, that <html> and <body> have the same width. In case you don't and you have something like that...
body {width:960px;margin:0 auto;}
jSnow will not work properly. If you are faced with this situation, just create an div element with an unique id and place exactly after <body>. For example:
<body><div id="THE_BODY">...rest of html code...</div></html>
and then place the CSS rule you to the new div:
#THE_BODY {width:960px;margin:0 auto;}
if you are wandering am I putting to all this trouble, it's because I haven't found a way (yet) to append DOM elements directly to <html> tag in IE 6 & IE7. I've spend hours and hours of reading and searching, but I found nothing! If I want to add dynamic DOM content to a document I must do it in <body> tag, not <html>. All other browsers, work fine with appending DOM elements directly to <html>, but I had to make this sucrfice in order for jSnow to be compatible with the IE6 and IE7. If anyone knows a way of adding DOM elements directly to <html> (not <body>)...I beg him to teach me :)
jSnow can take the following parameters.
flakeColor:["#f00","#0f0","#00f"].flakeMaxSize and flakeMinSize.No tricks just simple white falling snow!
jQuery CODE:$().jSnow();
In case you want something different and more colorful...
jQuery CODE:$().jSnow({flakeCode:["♠","♥","♣","♦"],flakeColor:["#f00","#0f0","#00f"],flakeMaxSize:20,flakeMinSize:20});
You can create snow flakes with just one element (image, character or HTML character) or any kind of mixture.
jQuery CODE:$().jSnow({flakeCode:["•","path/to/image_file/file_name.gif"]});
jSnow is released under GPL Open Source Licenses...thus it is completely and totally free!. You are obligated to keep all credits (links, names etc) and if you feel like it...a link to this page will be appreciated!
Comments
Do you have the unpacked
Do you have the unpacked source for this?
You can unpack any packed
Sure...
I am working on an update. I will publish it with version 1.1
I like
Thanks for sharing your plugin. I like it.
snow in a div
Not yet :0
Currently this feature is not supported...probably in version 1.3 will
Corrections
I am currently releasing v1.1
You should check it in a couple of days. I fixed a lot of bugs and issues that you one that you described. The problem with the animation is also fixed, since a) i increased the interval circle (plus parameter to control it) and b) I found out that 50 items moving on the screen with javascript is way too much, so the new default number of snowflakes is 30 (and it runs a lot better)!I have optimized the animation code, but with all the changes above it runs pretty smoothly.
Thanks for the snowflakes --
sure
will do :)
Problem
I can't find the problem
Can you please send me the code? I've seen that you are using some strange tricks with iframe maybe we should adjust the code.
Sorry. However the right url
Unpacked source
For faster service...
send me an email and I will send you the code.
It stops the page from scrolling
Download...
Download the versions that I've uploaded here the on in plugins.jquery.com has problems!
It's IE6 specific
Is there any way ...
Yep...there will be!
In version 1.2, I will have a function to shut it down and turn it back on (probably used with some kind of toggle)
swingRange option...
Version 1.2
I will implement it in version 1.2, i forgot to do it in version 1.1 :)
I like it!
scroll page doesn work
You still need to add CSS rules
It depends...
I think it depends on the layout, I don't want to mess a lot with the CSS part and ruin the users theme. If I could I would remove all of my CSS injections, but due to browser incompatibility I can't.
easy way to unpack source
Only within a div
Very very nice
I am glad :)
Glad that I helped you
Can't get it to turn off!!!!
Umm ok that didn't work hopefully this will
Umm that last post just converted my code to junk so here it is (hopefully this will work)
Snow
This is the code we are using to try it to stop snowing:
Stop Snow
I've tried a ton of variations but do you have any idea how to get this to work? Thanks.
Ok this isn't working one more try
Re
It is nice. I hope i can use
Post new comment