<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>JavaScriptly &#187; Misc</title> <atom:link href="http://javascriptly.com/category/misc/feed/" rel="self" type="application/rss+xml" /><link>http://javascriptly.com</link> <description>JavaScript Techniques, Tricks and News</description> <lastBuildDate>Thu, 07 Jan 2010 13:47:39 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Something for Christmas: Snowfall in Picture</title><link>http://javascriptly.com/2009/12/something-for-christmas-snowfall-in-picture/</link> <comments>http://javascriptly.com/2009/12/something-for-christmas-snowfall-in-picture/#comments</comments> <pubDate>Wed, 23 Dec 2009 07:05:26 +0000</pubDate> <dc:creator>Jimmy Vu</dc:creator> <category><![CDATA[Misc]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[effect]]></category> <category><![CDATA[snowfall]]></category><guid isPermaLink="false">http://javascriptly.com/?p=62</guid> <description><![CDATA[ Now it is time for Christmas and if you want to add some snows to a picture like the below example, a cool jQuery plugin &#8212; created by Jason Brown &#8212; can come to help.View Live Demo Download PluginJust include the plugin along with the latest version of jQuery (1.3.2 currently) and initiate it as the [...]]]></description> <content:encoded><![CDATA[<p></p><p style="text-align: justify;">Now it is time for Christmas and if you want to add some snows to a picture like the below example, a cool jQuery plugin &#8212; created by <a href="http://www.somethinghitme.com/2009/12/20/snowfall-plugin-updated/" target="_blank">Jason Brown</a> &#8212; can come to help.</p><p><a href="http://javascriptly.com/wp-content/uploads/2009/12/snow-fall-in-picture.png" rel="lightbox"><img src="http://javascriptly.com/wp-content/uploads/2009/12/snow-fall-in-picture-500x378.png" alt="" title="snow-fall-in-picture" width="500" height="378" class="aligncenter size-medium wp-image-141" /></a></p><ul><li><strong><a href="http://javascriptly.com/examples/jquery-snowfall/">View Live Demo</a></strong></li><li><strong><a href="http://javascriptly.com/examples/jquery-snowfall/snowfall.jquery.zip">Download Plugin</a></strong></li></ul><p><span id="more-62"></span></p><p style="text-align: justify;">Just include the plugin along with the latest version of jQuery (1.3.2 currently) and initiate it as the following code</p><div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#snow_window'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">snowfall</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		flakeCount <span style="color: #339933;">:</span> <span style="color: #CC0000;">50</span><span style="color: #339933;">,</span>
		flakeColor <span style="color: #339933;">:</span> <span style="color: #3366CC;">'#ffffff'</span><span style="color: #339933;">,</span>
		flakeIndex<span style="color: #339933;">:</span> <span style="color: #CC0000;">999999</span><span style="color: #339933;">,</span>
		minSize <span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span>
		maxSize <span style="color: #339933;">:</span> <span style="color: #CC0000;">4</span><span style="color: #339933;">,</span>
		minSpeed <span style="color: #339933;">:</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">,</span>
		maxSpeed <span style="color: #339933;">:</span> <span style="color: #CC0000;">5</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div><p style="text-align: justify;">where &#8220;<em>snow_window</em>&#8221; is the ID of target DIV in which snowflakes will fly. You can define number of snowflakes, their color, min/max sizes (just do not set too big sizes or they would look unnatural) and falling speed as parameters (<em>flakeCount</em>, <em>flakeColor</em> etc) in the initializing code.</p><p style="text-align: justify;">Of course, you can set the snowfall effect to the whole web page with</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">snowfall</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p style="text-align: justify;"><strong>Tip:</strong> It won&#8217;t work properly with fixed positioning and you must explicitly set the target DIV with &#8220;<em>position: relative</em>&#8221; or you&#8217;ll see snow falling on top corner of the page instead.</p><p style="text-align: justify;">I hope you enjoy this Christmas and can surprise your friends with the snowfall effect.</p><div id="crp_related"><h2>Related Posts:</h2><ul><li><a href="http://javascriptly.com/2009/12/best-ie6-png-fixes/" rel="bookmark">Best IE6 “PNG Alpha-Transparency” Fixes</a></li><li><a href="http://javascriptly.com/2008/09/quick-useful-jquery-plugins/" rel="bookmark">Quick & Useful jQuery Plugins</a></li><li><a href="http://javascriptly.com/2009/12/firequery-an-introduction/" rel="bookmark">FireQuery - An Introduction</a></li></ul></div>]]></content:encoded> <wfw:commentRss>http://javascriptly.com/2009/12/something-for-christmas-snowfall-in-picture/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 6/18 queries in 0.095 seconds using disk

Served from: quangvhg.virtual.vps-host.net @ 2010-09-08 13:07:49 -->