<?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>blarnee.com &#187; Code Samples</title>
	<atom:link href="http://blarnee.com/wp/category/code-samples/feed/" rel="self" type="application/rss+xml" />
	<link>http://blarnee.com/wp</link>
	<description>Web design and development online &#124; Adnan Osmani's blog</description>
	<lastBuildDate>Fri, 03 Sep 2010 18:35:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>jQuery UI Animation Effects</title>
		<link>http://blarnee.com/wp/jquery-ui-animation-effects/</link>
		<comments>http://blarnee.com/wp/jquery-ui-animation-effects/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 19:09:45 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[animation effects]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[javascript effects]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery animation]]></category>
		<category><![CDATA[jquery UI]]></category>

		<guid isPermaLink="false">http://blarnee.com/wp/?p=650</guid>
		<description><![CDATA[The jQuery UI Effects Core brings a few more advanced animation techniques to the design table and this quick post will give you a complete example of how to use each effect (with an inline demo). They&#8217;re very straight-forward to use and could give you just that little extra eye-candy your project needs to make [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/12-new-examples-of-advanced-animation-with-jquery/' rel='bookmark' title='Permanent Link: 12 new examples of Advanced Animation techniques with jQuery'>12 new examples of Advanced Animation techniques with jQuery</a> <small>When you think about animation on the internet, chances are...</small></li><li><a href='http://blarnee.com/wp/the-best-advanced-animation-techniques-you-can-perform-using-jquery/' rel='bookmark' title='Permanent Link: The Best Advanced Animation techniques you can perform using jQuery'>The Best Advanced Animation techniques you can perform using jQuery</a> <small>When you think about animation on the internet, chances are...</small></li><li><a href='http://blarnee.com/wp/how-to-create-impressive-animations-in-jquery-with-animate/' rel='bookmark' title='Permanent Link: How to create impressive animations in jQuery with .animate()'>How to create impressive animations in jQuery with .animate()</a> <small> I&#8217;ve been asked many times over the past month...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.blarnee.com/wp/animation.jpg" alt="" /></p>
<p>The jQuery UI Effects Core brings a few more advanced animation techniques to the design table and this quick post will give you a complete example of how to use each effect (with an inline demo). They&#8217;re very straight-forward to use and could give you just that little extra eye-candy your project needs to make it memorable.I hope the post is useful!.    <script type="text/javascript" src="https://www.google.com/jsapi"></script>  <script type="text/javascript">google.load("jquery", "1.3");</script>   <script type="text/javascript">google.load("jqueryui", "1.7");</script>  <script type="text/javascript"> 
$(function() {
    $("#but-blind").toggle(
        function() {
            $("#blind").hide("blind", { direction: "vertical" }, 1000);
        },
        function() {
            $("#blind").show("blind", { direction: "horizontal" }, 500);
        }
    );
    $("#but-clip").toggle(
        function() {
            $("#clip").hide("clip", { direction: "vertical" }, 1000);
        },
        function() {
            $("#clip").show("clip", { direction: "horizontal" }, 500);
        }
    );
    $("#but-drop").toggle(
        function() {
            $("#drop").hide("drop", { direction: "right" }, 1000);
        },
        function() {
            $("#drop").show("drop", { direction: "down" }, 500);
        }
    );
    $("#but-explode").toggle(
        function() {
            $("#explode").hide("explode", {}, 1000);
        },
        function() {
            $("#explode").show("explode", { pieces: 20 }, 500);
        }
    );
    $("#but-fold").toggle(
        function() {
            $("#fold").hide("fold", {}, 1000);
        },
        function() {
            $("#fold").show("fold", {}, 500);
        }
    );
    $("#but-puff").toggle(
        function() {
            $("#puff").hide("puff", {}, 1000);
        },
        function() {
            $("#puff").show("puff", {}, 500);
        }
    );
    $("#but-slide").toggle(
        function() {
            $("#slide").hide("slide", { direction: "right" }, 1000);
        },
        function() {
            $("#slide").show("slide", { direction: "down" }, 500);
        }
    );
    $("#but-scale").toggle(
        function() {
            $("#scale").effect("scale", { percent: 50 }, 1000);
        },
        function() {
            $("#scale").effect("scale", { percent: 200 }, 500);
        }
    );
    $("#but-scale2").toggle(
        function() {
            $("#scale2").hide("scale", {}, 1000);
        },
        function() {
            $("#scale2").show("scale", { percent: 100 }, 500);
        }
    );
    $("#but-scale3").toggle(
        function() {
            $("#scale3").effect("scale", { percent: 200, direction: "horizontal" }, 1000);
        },
        function() {
            $("#scale3").effect("scale", { percent: 50, direction: "horizontal"  }, 500);
        }
    );
    $("#but-pulsate").toggle(
        function() {
            $("#pulsate").effect("pulsate", { times: 1 }, 1000);
        },
        function() {
            $("#pulsate").effect("pulsate", { times: 4 }, 100);
        }
    );
    $("#but-bounce").toggle(
        function() {
            $("#bounce").effect("bounce", { times: 2 }, 1000);
        },
        function() {
            $("#bounce").effect("bounce", { times: 4 }, 100);
        }
    );
    $("#but-highlight").toggle(
        function() {
            $("#highlight").effect("highlight", {}, 1000);
        },
        function() {
            $("#highlight").effect("highlight", {}, 100);
        }
    );
    $("#but-shake").toggle(
        function() {
            $("#shake").effect("shake", { times: 2 }, 200);
        },
        function() {
            $("#shake").effect("shake", { times: 4 }, 100);
        }
    );
    $("#but-transfer").toggle(
        function() {
            $("#transfer").effect("transfer", { to: "#transfer-to" }, 1000);
        },
        function() {
            $("#transfer-to").effect("transfer", { to: "#transfer" }, 500);
        }
    );
});
</script></p>
<p>
<style type="text/css"> 
.box {
    background-color:#666;
    margin:0.5em;
    width:100px;
    height:100px;
}
#transfer-to {
    background-color: #CFD4E6;
    margin: 0.5em;
    width: 20px;
    height: 20px;
}
.ui-effects-transfer {
    background-color: #CFD4E6;
    border: 1px solid #000000;
}
</style>
</p>
<h2>The Blinds Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-blind" class="but" title="click me">blind-test</button>
</dt>
<dd>
<div id="blind" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-blind'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#blind'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'blind'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'vertical'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#blind'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'blind'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'horizontal'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Clipping Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-clip" class="but" title="click me">clip-test</button>
</dt>
<dd>
<div id="clip" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-clip'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#clip'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'clip'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'vertical'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#clip'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'clip'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'horizontal'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Drop Animation Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-drop" class="but" title="click me">drop-test</button>
</dt>
<dd>
<div id="drop" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-drop'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#drop'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'drop'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'right'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#drop'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'drop'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'down'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Explode Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-explode" class="but" title="click me">explode-test</button>
</dt>
<dd>
<div id="explode" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-explode'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#explode'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'explode'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#explode'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'explode'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> pieces<span style="color: #339933;">:</span> <span style="color: #CC0000;">30</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Folding Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-fold" class="but" title="click me">fold-test</button>
</dt>
<dd>
<div id="fold" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-fold'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#fold'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'fold'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#fold'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'fold'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Puffing Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-puff" class="but" title="click me">puff-test</button>
</dt>
<dd>
<div id="puff" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-puff'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#puff'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'puff'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#puff'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'puff'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Sliding Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-slide" class="but" title="click me">slide-test</button>
</dt>
<dd>
<div id="slide" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-slide'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#slide'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slide'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'right'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#slide'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slide'</span><span style="color: #339933;">,</span>  direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'down'</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Scaling Effect (Type 1)</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-scale" class="but" title="click me">scale-test</button>
</dt>
<dd>
<div id="scale" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-scale'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#scale'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'scale'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> percent<span style="color: #339933;">:</span> <span style="color: #CC0000;">50</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#scale'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'scale'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> percent<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Scaling Effect (Type 2)</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-scale2" class="but" title="click me">scale2-test</button>
</dt>
<dd>
<div id="scale2" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-scale2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#scale2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'scale'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#scale2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'scale'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> percent<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Scaling Effect (Type 3)</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-scale3" class="but" title="click me">scale3-test</button>
</dt>
<dd>
<div id="scale3" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-scale3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#scale3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'scale'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> percent<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'horizontal'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#scale3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'scale'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> percent<span style="color: #339933;">:</span> <span style="color: #CC0000;">50</span><span style="color: #339933;">,</span> direction<span style="color: #339933;">:</span> <span style="color: #3366CC;">'horizontal'</span>  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Pulsating Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-pulsate" class="but" title="click me">pulsate-test</button>
</dt>
<dd>
<div id="pulsate" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-pulsate'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#pulsate'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'pulsate'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> times<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#pulsate'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'pulsate'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> times<span style="color: #339933;">:</span> <span style="color: #CC0000;">4</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Bouncing Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-bounce" class="but" title="click me">bounce-test</button>
</dt>
<dd>
<div id="bounce" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-bounce'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#bounce'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'bounce'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> times<span style="color: #339933;">:</span> <span style="color: #CC0000;">2</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#bounce'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'bounce'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> times<span style="color: #339933;">:</span> <span style="color: #CC0000;">4</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Highlight Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-highlight" class="but" title="click me">highlight-test</button>
</dt>
<dd>
<div id="highlight" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-highlight'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#highlight'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'highlight'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#highlight'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'highlight'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Shake Effect</h2>
<div class="testarea">
<dl>
<dt type="disk">             <button id="but-shake" class="but" title="click me">shake-test</button>
</dt>
<dd>
<div id="shake" class="box">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-shake'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#shake'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'shake'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> times<span style="color: #339933;">:</span> <span style="color: #CC0000;">2</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#shake'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'shake'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> times<span style="color: #339933;">:</span> <span style="color: #CC0000;">4</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>The Transfer Effect</h2>
<div>
<dl>
<dt type="disk">             <button id="but-transfer" class="but" title="click me">transfer-test</button>
</dt>
<dd>
<div id="transfer" class="box">&nbsp;</div>
<div id="transfer-to">&nbsp;</div>
<p>
</dd>
</dl>
</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#but-transfer'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#transfer'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'transfer'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> to<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#transfer-to'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#transfer-to'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">effect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'transfer'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> to<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#transfer'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_GB"></script><script type="text/javascript">FB.init("05245ba91ee2d18e5dfe3ec750abd6bb");</script><fb:fan width="600" logobar="1" connections="10" stream="1" profile_id="129712729600"></fb:fan></p>
<div style="font-size: 8px; padding-left: 10px;"><a href="http://www.facebook.com/pages/Addy-Osmani/129712729600">Addy Osmani</a> on Facebook</div>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2Fjquery-ui-animation-effects%2F&amp;t=jQuery%20UI%20Animation%20Effects%20" id="facebook_share_button_650" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_650') || document.getElementById('facebook_share_icon_650') || document.getElementById('facebook_share_both_650') || document.getElementById('facebook_share_button_650');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_650') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/12-new-examples-of-advanced-animation-with-jquery/' rel='bookmark' title='Permanent Link: 12 new examples of Advanced Animation techniques with jQuery'>12 new examples of Advanced Animation techniques with jQuery</a> <small>When you think about animation on the internet, chances are...</small></li><li><a href='http://blarnee.com/wp/the-best-advanced-animation-techniques-you-can-perform-using-jquery/' rel='bookmark' title='Permanent Link: The Best Advanced Animation techniques you can perform using jQuery'>The Best Advanced Animation techniques you can perform using jQuery</a> <small>When you think about animation on the internet, chances are...</small></li><li><a href='http://blarnee.com/wp/how-to-create-impressive-animations-in-jquery-with-animate/' rel='bookmark' title='Permanent Link: How to create impressive animations in jQuery with .animate()'>How to create impressive animations in jQuery with .animate()</a> <small> I&#8217;ve been asked many times over the past month...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blarnee.com/wp/jquery-ui-animation-effects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Offline Cross-Browser Client-Side Storage for the Web using JavaScript and a little Flash</title>
		<link>http://blarnee.com/wp/offline-cross-browser-client-side-storage-for-the-web-using-javascript-and-a-little-flash/</link>
		<comments>http://blarnee.com/wp/offline-cross-browser-client-side-storage-for-the-web-using-javascript-and-a-little-flash/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 03:46:37 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[client-side]]></category>
		<category><![CDATA[client-side storage]]></category>
		<category><![CDATA[clientside]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[cross-browser]]></category>
		<category><![CDATA[file store]]></category>
		<category><![CDATA[firefox localstorage]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash storage]]></category>
		<category><![CDATA[google gears]]></category>
		<category><![CDATA[googlegears]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 localstore]]></category>
		<category><![CDATA[html5 sql]]></category>
		<category><![CDATA[html5 storage]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[local storage space]]></category>
		<category><![CDATA[localstorage]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[offline client-side storage]]></category>
		<category><![CDATA[offline storage]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[settings storage]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[storage offline]]></category>
		<category><![CDATA[store files locally]]></category>
		<category><![CDATA[web storage]]></category>
		<category><![CDATA[website files local]]></category>
		<category><![CDATA[website storage]]></category>

		<guid isPermaLink="false">http://addyosmani.com/blog/offline-cross-browser-client-side-storage-for-the-web-using-javascript-and-a-little-flash/</guid>
		<description><![CDATA[&#160; Hi guys. Today I&#8217;m going to show you how to do persistent Client-side storage that&#8217;ll work in any Web Browser without needing to use Cookies, Browser-Specific hacks or HTML5 &#8211; in other words, we&#8217;re going to store as much custom information as a site needs on a user&#8217;s system without needing to worry about [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/7-really-useful-tips-for-better-jquery-code/' rel='bookmark' title='Permanent Link: 7 Really Useful Tips For Better jQuery Code'>7 Really Useful Tips For Better jQuery Code</a> <small>&nbsp; I&rsquo;ve been using jQuery in my web apps for...</small></li><li><a href='http://blarnee.com/wp/get-back-more-storage-space-in-windows-vista-part-2/' rel='bookmark' title='Permanent Link: Get back more storage space in Windows Vista &#8211; Part 2'>Get back more storage space in Windows Vista &#8211; Part 2</a> <small>Windows Vista has a unique feature known as a shadow...</small></li><li><a href='http://blarnee.com/wp/web-workers-amazing-parallel-javascript-tasking-for-your-application/' rel='bookmark' title='Permanent Link: Web Workers &#8211; Amazing Parallel JavaScript Tasking For Your Application'>Web Workers &#8211; Amazing Parallel JavaScript Tasking For Your Application</a> <small>&#160; I’ve been looking at some of the cool new...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a class="thickbox" href="http://blarnee.com/wp/wp-content/uploads/client.jpg"><img border="0" title="client" style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" alt="client" src="http://blarnee.com/wp/wp-content/uploads/client_thumb.jpg" /></a>&nbsp;</p>
<p>Hi guys. Today I&rsquo;m going to show you how to do <strong>persistent Client-side storage</strong> that&rsquo;ll work in any Web Browser <strong>without</strong> needing to use Cookies, Browser-Specific hacks or HTML5 &ndash; in other words, we&rsquo;re going to store as much custom information as a site needs on a user&rsquo;s system without needing to worry about compatibility issues.</p>
<p><span id="more-610"></span></p>
<p>&nbsp;</p>
<p>The reason we&rsquo;re interested in doing this is because it has a huge potential to free up database resources if we don&rsquo;t need to be saving information there &#8211; instead it can be readily loaded from our users computer through client-side storage. Even if you <strong>need</strong> to save data, you can always store it on your user&rsquo;s system and log it to the server it at a later date in the week.</p>
<p>&nbsp;</p>
<p>The inspiration behind this article was research I was putting into discovering the best way to achieve offline client-side storage using FireFox&rsquo;s <a href="http://hacks.mozilla.org/2009/06/localstorage/">LocalStorage</a>, HTML5&rsquo;s <a href="http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/">local databases</a> and Chrome&rsquo;s <a href="http://gears.google.com/">Google Gears</a>. Projects such as <a href="http://pablotron.org/?cid=1557">PersistJS</a> have tried to provide a pack that allows you to switch between any of these for your storage options (depending on what browser you have) but even then.. he problem has always been that there wasn&rsquo;t <strong>one solution</strong> that works well across all platforms and browsers&hellip;lets dive in and see if we can address that.</p>
<p>&nbsp;</p>
<p><a class="thickbox" href="http://blarnee.com/wp/wp-content/uploads/1255932843_yahoo.png"><img width="128" height="128" border="0" align="left" title="1255932843_yahoo" style="border-width: 0px; margin: 0px 20px 0px 0px; display: inline;" alt="1255932843_yahoo" src="http://blarnee.com/wp/wp-content/uploads/1255932843_yahoo_thumb.png" /></a></p>
<p>Our solution today is going to make use of a little-used YUI component created called <a href="http://developer.yahoo.com/yui/examples/swfstore/swfstore-advanced-example.html">SWFStore</a>. SWFStore allows you to store and access data in the Flash data store through a brilliant object-oriented JavaScript wrapper that makes it very straight-forward to add, update or remove data through your JavaScript code. It&rsquo;s clean and works very very well. This isn&rsquo;t the first time this method of storage has been tried, but the reason I chose to use SWFStore as the basis of this solution is because it offers a clean-way to extend how much data a site can store. For anyone that&rsquo;s aware of how Flash manages data, there&rsquo;s a basic limit of <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager.html#117152">100KB</a> per-domain imposed when you first start using it. SWFStore can however help you to easily <strong>prompt </strong>users to extend their Flash storage space and after that you&rsquo;re able to store as much data as you would like locally [<a href="http://developer.yahoo.com/yui/examples/swfstore/swfstore-settings-example_source.html">see advanced demo here</a>]</p>
<p>&nbsp;</p>
<p>I <strong>extended </strong>SWFStore using just a few functions so that I could easily save and retrieve data anywhere in the DOM tree. What I was able to do (and what you&rsquo;ll learn to do by the end of this article) is store any number of variables, text, html, data or objects for a site and load them up every time <strong>without needing to touch SQL</strong>. Using SWFStore was so straight-forward that I was even able to store all the reference data for a Google Calendar-like app locally, but let&rsquo;s get through some of the basics :)</p>
<p>&nbsp;</p>
<p><strong><font size="4">Demo and Tutorial</font></strong></p>
<p>&nbsp;</p>
<p><a class="thickbox" href="http://blarnee.com/wp/wp-content/uploads/image15.png"><img width="391" height="244" border="0" title="image" style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" alt="image" src="http://blarnee.com/wp/wp-content/uploads/image_thumb14.png" /></a></p>
<p>&nbsp;</p>
<p>Before we look at any code, I think it&rsquo;s always useful to show a <strong>demo</strong> of what we&rsquo;re going to be building. <a href="http://www.addyosmani.com/resources/swfstore/examples/swfstore/test.html"><strong>Here</strong></a> I&rsquo;ve created a simple YUI app that allows you to save some <strong>sample data</strong> about a user to their local Flash data cache using JavaScript. This data includes <em>a nickname, custom background-image</em>, <em>reminder note</em>, <em>avatar, last page viewed on the site, hypothetical theme </em>and more.</p>
<p>&nbsp;</p>
<p>To help visualize the variables we&rsquo;re using a YUI DataTable in our page too and this is what the data looks like when populated inside:</p>
<p>&nbsp;</p>
<p><a class="thickbox" href="http://blarnee.com/wp/wp-content/uploads/image16.png"><img width="528" height="190" border="0" title="image" style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" alt="image" src="http://blarnee.com/wp/wp-content/uploads/image_thumb15.png" /></a></p>
<p>&nbsp;</p>
<p>In the <strong>default view</strong> you&rsquo;re presented with a welcome Guest screen that uses the page&rsquo;s default settings. After you&rsquo;ve <strong>saved the sample data</strong> however, reload the page and you will see that every time you go back to it..your custom settings are now being used to render the modal window&rsquo;s data the way you &lsquo;chose&rsquo;. This could be taken further to render the page with different css, widgets or other elements depending on what the user wants, but for now this is enough to illustrate the concept.</p>
<p>&nbsp;</p>
<p>To use the SWFStore, include the following source files in your web page:</p>
<p>&nbsp;</p>
<p><font face="Courier" color="#804000"><strong>Dependencies</strong>&nbsp; <br />
&lt;script type=&quot;text/javascript&quot; src=&quot;</font><a href="http://yui.yahooapis.com/2.8.0r4/build/yahoo/yahoo.js&quot;"><font face="Courier" color="#804000">http://yui.yahooapis.com/2.8.0r4/build/yahoo/yahoo.js&quot;</font></a><font face="Courier" color="#804000">&gt;</font></p>
<p><font face="Courier" color="#804000">&lt;/script&gt;&nbsp; <br />
&lt;script type=&quot;text/javascript&quot; src=&quot;</font><a href="http://yui.yahooapis.com/2.8.0r4/build/dom/dom.js&quot;"><font face="Courier" color="#804000">http://yui.yahooapis.com/2.8.0r4/build/dom/dom.js&quot;</font></a><font face="Courier" color="#804000">&gt;</font></p>
<p><font face="Courier" color="#804000">&lt;/script&gt; </font></p>
<p><font face="Courier" color="#804000"></p>
<p>
<strong>Source files</strong><br />
&lt;script type=&quot;text/javascript&quot; src=&quot;</p>
<p><a href="http://yui.yahooapis.com/2.8.0r4/build/swfstore/swfstore.js&quot;"><font face="Courier" color="#804000">http://yui.yahooapis.com/2.8.0r4/build/swfstore/swfstore.js&quot;</font></a><font face="Courier" color="#804000">&gt;</font></font></p>
<p><font face="Courier" color="#804000">&lt;/script&gt;</font></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>By default, the file swfstore.swf is expected in the same directory as the HTML page in which a SWFStore Utility instance will appear. You must place a copy of the SWF on your server.</p>
<p>&nbsp;</p>
<p>To get started with the SWFStore, begin by placing it on the page. Create a &lt;div&gt; (or other element) placeholder into which you&rsquo;re able to render your SWFStore instance. In a usual use cases, you can set the width and height of the container to 0, since the SWFStore is a purely functional component and doesn&rsquo;t have it&rsquo;s own UI (except when your users want to request more storage space from Flash):</p>
<p>&nbsp;</p>
<p>&nbsp;<font face="Courier" color="#804000">&nbsp;&nbsp; &lt;div id=&quot;toBeReplaced&quot; style=&quot;width:0px;height:0px&quot;&gt;&lt;br /&gt;      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sorry guys! We&rsquo;re unable to load Flash content. The YUI SWFStore Utility requires Flash Player 9.0.115 or higher. &lt;br /&gt;&nbsp; <br />
&nbsp;&nbsp;&nbsp; &lt;/div&gt;</font></p>
<p>&nbsp;</p>
<p>Then, instantiate the SWFStore by passing the id of this container &lt;div&gt; to it:</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; <font face="Courier" color="#804000">var swfstore = new YAHOO.util.SWFStore( &quot;toBeReplaced&quot; );</font></p>
<p>&nbsp;</p>
<p>The demo I created consists of two text fields, a few Buttons and a DataTable as well as a modal window. The Buttons let you save data, set some sample information to store, set properties on SWFStore, or clear all items from the data store.</p>
<p>&nbsp;</p>
<p><a class="thickbox" href="http://blarnee.com/wp/wp-content/uploads/image17.png"><img width="419" height="233" border="0" title="image" style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" alt="image" src="http://blarnee.com/wp/wp-content/uploads/image_thumb16.png" /></a></p>
<p>&nbsp;</p>
<p>Once the page has been loaded up, the initialize() function is called to instantiate a SWFStore instance and set up some listeners. To be safe, we also disable all of the Buttons until the SWFStore is ready &ndash; good UI practices always come in handy.</p>
<p>&nbsp;</p>
<p>&nbsp;<font face="Courier" color="#804000">&nbsp;&nbsp; function initialize()      <br />
&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp; var useCompression = compressionCheckbox.get(&quot;checked&quot;);       <br />
&nbsp;&nbsp;&nbsp; saveButton.set(&quot;disabled&quot;, true); </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; setButton.set(&quot;disabled&quot;, true);      <br />
&nbsp;&nbsp;&nbsp; purgeButton.set(&quot;disabled&quot;, true);       <br />
&nbsp;&nbsp;&nbsp; removeButton.set(&quot;disabled&quot;, true);       <br />
&nbsp;&nbsp;&nbsp; removeAtButton.set(&quot;disabled&quot;, true);       <br />
&nbsp;&nbsp;&nbsp; sharedataCheckbox.set(&quot;disabled&quot;, true);&nbsp; <br />
&nbsp;&nbsp;&nbsp; compressionCheckbox.set(&quot;disabled&quot;, true); </font></p>
<p>
<font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; //the swfstore instance </font></p>
<p>
<font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; swfstore = new YAHOO.util.SWFStore(&quot;swfstoreContainer&quot;, false, useCompression); </font></p>
<p>
<font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; //some basic listeners for user feedback      <br />
&nbsp;&nbsp;&nbsp; swfstore.addListener(&quot;save&quot;, onSave);       <br />
&nbsp;&nbsp;&nbsp; swfstore.addListener(&quot;error&quot;, onError);       <br />
&nbsp;&nbsp;&nbsp; swfstore.addListener(&quot;quotaExceededError&quot;, onError);       <br />
&nbsp;&nbsp;&nbsp; swfstore.addListener(&quot;securityError&quot;, onError);       <br />
&nbsp;&nbsp;&nbsp; swfstore.addListener(&quot;contentReady&quot;, onContentReady);</font></p>
<p>&nbsp;</p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; //extended listeners</font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp; swfstore.addListener(&quot;set&quot;, onSet);</font>&nbsp;</p>
<p>&nbsp;</p>
<p>When SWFStore is ready, it will dispatch a contentReady event. We can then enable the Buttons and initialize a DataTable with any previously stored values. Because items are stored as objects, we need to loop through them to turn them into name-value pairs suitable for use with the DataTable.</p>
<p>
&nbsp;<font face="Courier" color="#804000">&nbsp;&nbsp; function onContentReady(event)      <br />
&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; saveButton.set(&quot;disabled&quot;, false);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; purgeButton.set(&quot;disabled&quot;, false);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; removeButton.set(&quot;disabled&quot;, false);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; removeAtButton.set(&quot;disabled&quot;, false);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sharedataCheckbox.set(&quot;disabled&quot;, false);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compressionCheckbox.set(&quot;disabled&quot;, false); </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setButton.set(&quot;disabled&quot;, false);      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; load();       <br />
&nbsp;&nbsp;&nbsp; } </font></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><font face="Courier" color="#804000">//next we define default values for the variables we load when the page is opened</font></p>
<p>&nbsp;</p>
<p><font size="2" face="Courier" color="#804000">&nbsp; var layout = &quot;Default&quot;;</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp; var fontname = &quot;Verdana&quot;;</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp; var friendlyname = &quot;Guest&quot;;</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp; var windowSize = &quot;400px&quot;</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp; var reminder1 = &quot;No reminders set&quot;;</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp; var avatarURL =&nbsp;&nbsp; &quot;http://www.addyosmani.com/resources/swfstore/examples/</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp; swfstore/default.png&quot;;</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp; var lastViewed = &quot;&quot;;</font></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; function load()      <br />
&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //could use swfstore.getItems(), but that would not separate the data into fields </font></p>
<p>&nbsp;</p>
<p><font face="Courier" color="#804000">var settingName = null;</font></p>
<p><font face="Courier" color="#804000">var settingValue = null;</font></p>
<p><font face="Courier" color="#804000">var len = swfstore.getLength();</font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var arr = []; </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var i = 0; i &lt; len; i++)      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arr.push({ name:swfstore.getNameAt(i), value: swfstore.getValueAt(i) }) </font></p>
<p>&nbsp;</p>
<p><font size="2" face="Courier" color="#804000">settingName = swfstore.getNameAt(i);</font></p>
<p><font size="2" face="Courier" color="#804000">settingValue = swfstore.getValueAt(i);</font></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><font size="2" face="Courier" color="#804000">//here we use a switch statement to check the value loaded from the data-table. We are then able to assign it to a more easy to remember variable name and read it anywhere in the DOM</font></p>
<p>&nbsp;</p>
<p><font size="2" face="Courier" color="#804000">switch(settingName)</font></p>
<p><font size="2" face="Courier" color="#804000">{</font></p>
<p><font size="2" face="Courier" color="#804000">case &#8216;layout&#8217;:</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layout = settingValue;</font></p>
<p><font size="2" face="Courier" color="#804000">break;</font></p>
<p><font size="2" face="Courier" color="#804000">case &#8216;font&#8217;:</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fontname = settingValue;</font></p>
<p><font size="2" face="Courier" color="#804000">break;</font></p>
<p><font size="2" face="Courier" color="#804000">case &#8216;friendlyName&#8217;:</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; friendlyname = settingValue;</font></p>
<p><font size="2" face="Courier" color="#804000">break;</font></p>
<p><font size="2" face="Courier" color="#804000">case &#8216;windowSize&#8217;:</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; windowSize = settingValue;</font></p>
<p><font size="2" face="Courier" color="#804000">break;</font></p>
<p><font size="2" face="Courier" color="#804000">case &#8216;backgroundImage&#8217;:</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; backgroundImage = settingValue;</font></p>
<p><font size="2" face="Courier" color="#804000">break;</font></p>
<p><font size="2" face="Courier" color="#804000">case &#8216;reminder1&#8242;:</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reminder1 = settingValue;</font></p>
<p><font size="2" face="Courier" color="#804000">break;</font></p>
<p><font size="2" face="Courier" color="#804000">case &#8216;avatarURL&#8217;:</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; avatarURL = settingValue;</font></p>
<p><font size="2" face="Courier" color="#804000">break;</font></p>
<p><font size="2" face="Courier" color="#804000">case &#8216;lastViewed&#8217;:</font></p>
<p><font size="2" face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lastViewed = settingValue;</font></p>
<p><font size="2" face="Courier" color="#804000">break;</font></p>
<p><font size="2" face="Courier" color="#804000">}</font></p>
<p><font face="Courier" color="#804000"></p>
<p>
<font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font></p>
<p>&nbsp;</p>
<p></font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var datasource = new YAHOO.util.LocalDataSource(arr); </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datasource.responseSchema = {fields : [&quot;name&quot;, &quot;value&quot;]}; </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var configs =      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scrollable: true       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var columns =      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {key:&quot;name&quot;, label:&quot;Storage Name (Key)&quot;},       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {key:&quot;value&quot;, label:&quot;Text Stored&quot;}       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]; </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatable = new YAHOO.widget.DataTable(&quot;datatableContainer&quot;, columns, datasource, configs); </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; } </font></p>
<p>&nbsp;</p>
<p><a class="thickbox" href="http://blarnee.com/wp/wp-content/uploads/image18.png"><img width="465" height="148" border="0" title="image" style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" alt="image" src="http://blarnee.com/wp/wp-content/uploads/image_thumb17.png" /></a></p>
<p>The &ldquo;Set Test Data&rdquo; button allows you to set some test data (or any information) from a function or the rest of your UI to save into the data store. In the demo, I&rsquo;ve chosen to store some data for a fake user profile application that is loaded up and used by a modal window to demonstrate just how easy this is to use through JavaScript. To save an item call <strong>swfstore.setItem(variableName, variableValue). </strong></p>
<p>&nbsp;</p>
<p><font size="2" face="Courier" color="#804000">function set()</font></p>
<p><font size="2" face="Courier" color="#804000">{</font></p>
<p><font size="2" face="Courier" color="#804000">swfstore.setItem(&#8216;layout&#8217;, &#8216;helio&#8217;);</font></p>
<p><font size="2" face="Courier" color="#804000">swfstore.setItem(&#8216;font&#8217;, &#8216;tahoma&#8217;);</font></p>
<p><font size="2" face="Courier" color="#804000">swfstore.setItem(&#8216;friendlyName&#8217;, &#8216;John Smith&#8217;);</font></p>
<p><font size="2" face="Courier" color="#804000">swfstore.setItem(&#8216;windowSize&#8217;, &#8217;500px&#8217;);</font></p>
<p><font size="2" face="Courier" color="#804000">swfstore.setItem(&#8216;backgroundImage&#8217;, &#8216;http://farm3.static.flickr.com/2363/2085145159_85bd6d7be1_o.jpg&#8217;);</font></p>
<p><font size="2" face="Courier" color="#804000">swfstore.setItem(&#8216;reminder1&#8242;, &#8216;Feed the Cat today!&#8217;);</font></p>
<p><font size="2" face="Courier" color="#804000">swfstore.setItem(&#8216;avatarURL&#8217;, &#8216;http://www.addyosmani.com/resources/swfstore/examples/</font></p>
<p><font size="2" face="Courier" color="#804000">sswfstore/avatar.png&#8217;);</font></p>
<p><font size="2" face="Courier" color="#804000">swfstore.setItem(&#8216;lastViewed&#8217;, lastViewed);</font></p>
<p><font size="2" face="Courier" color="#804000">alert(&quot;Refresh this page to apply the new saved settings&quot;);</font></p>
<p><font size="2" face="Courier" color="#804000">}</font></p>
<p>&nbsp;</p>
<p>Similarly, the &quot;Save&quot; Button is set up to take the values from the text fields in our app and store them, using this function.</p>
<p>&nbsp;</p>
<p>&nbsp;<font color="#804000">&nbsp;&nbsp; function save()      <br />
&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swfstore.setItem(&nbsp; YAHOO.util.Dom.get(&#8216;nameField&#8217;).value, YAHOO.util.Dom.get(&#8216;valueField&#8217;).value);       <br />
&nbsp;&nbsp;&nbsp; }       <br />
</font></p>
<p>&nbsp;</p>
<p>Some of the other Buttons are set up to remove items from storage and are useful for cases where you would like to make sure all the local data for a site has been deleted.</p>
<p>&nbsp;</p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; function remove()      <br />
&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var obj = YAHOO.util.Dom.get(&#8216;nameField&#8217;).value;       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swfstore.removeItem(obj); </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; } </font></p>
<p>&nbsp;</p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; function removeItemAt()      <br />
&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var index = parseInt(YAHOO.util.Dom.get(&#8216;indexField&#8217;).value);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swfstore.removeItemAt(index); </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; } </font></p>
<p>&nbsp;</p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp; function purge()      <br />
&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swfstore.clear();       <br />
&nbsp;&nbsp;&nbsp; } </font></p>
<p>&nbsp;</p>
<p>We&#8217;ve already set up listeners for the &quot;save&quot; and &ldquo;set&rdquo; events, which are displayed for when each of their respective buttons are clicked. The onSet event loops through rows of the DataTable and either adds rows, deletes them or updates values.</p>
<p>&nbsp;</p>
<p><font size="2" face="Courier" color="#804000">function onSet(event)</font></p>
<p><font size="2" face="Courier" color="#804000">{</font></p>
<p><font size="2" face="Courier" color="#804000">var newobj = {name: event.key, value: event.newValue};</font></p>
<p><font size="2" face="Courier" color="#804000">var len = datatable.getRecordSet().getLength();</font></p>
<p><font size="2" face="Courier" color="#804000">//loop through current records and see if this has been added before</font></p>
<p><font size="2" face="Courier" color="#804000">for (var i = 0; i &lt; len; i++ )</font></p>
<p><font size="2" face="Courier" color="#804000">{</font></p>
<p><font size="2" face="Courier" color="#804000">var rec = datatable.getRecord(i);</font></p>
<p><font size="2" face="Courier" color="#804000">var data = rec.getData();</font></p>
<p><font size="2" face="Courier" color="#804000">//if it&#8217;s been added already, update it</font></p>
<p>&nbsp;</p>
<p><font size="2" face="Courier" color="#804000">if(data.name == event.key)</font></p>
<p><font size="2" face="Courier" color="#804000">{</font></p>
<p><font size="2" face="Courier" color="#804000">datatable.updateRow(i, newobj);</font></p>
<p><font size="2" face="Courier" color="#804000">return;</font></p>
<p><font size="2" face="Courier" color="#804000">}</font></p>
<p><font size="2" face="Courier" color="#804000">}</font></p>
<p><font size="2" face="Courier" color="#804000">//if it&#8217;s not been added, add it</font></p>
<p><font size="2" face="Courier" color="#804000">datatable.addRow(newobj);</font></p>
<p><font size="2" face="Courier" color="#804000">}</font></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The onSave function is very similar to onSet except it&rsquo;s more constricted to the UI controls in this demo whilst onSet and the &ldquo;set&rdquo; method are more open to being called from anywhere in your code and storing your data.</p>
<p>&nbsp;</p>
<p>&nbsp; <font face="Courier" color="#804000">&nbsp; function onSave(event)      <br />
&nbsp;&nbsp;&nbsp; { </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //added      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(event.info == &quot;add&quot; || event.info == &quot;update&quot;)       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var newobj = {name: event.key, value: event.newValue}; </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var len = datatable.getRecordSet().getLength(); </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //loop through current records and see if this has been added before      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var i = 0; i &lt; len; i++ )       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var rec = datatable.getRecord(i);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var data = rec.getData(); </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //if it&#8217;s been added already, update it      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(data.name == event.key)       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatable.updateRow(i, newobj);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //if it&#8217;s not been added, add it      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatable.addRow(newobj);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //removed      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if(event.info == &quot;delete&quot;)       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //var index = parseInt(YAHOO.util.Dom.get(&#8216;indexField&#8217;).value);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatable.deleteRow(event.index);       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font></p>
<p><font face="Courier" color="#804000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //cleared      <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatable.deleteRows(0, datatable.getRecordSet().getLength());       <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }       <br />
&nbsp;&nbsp;&nbsp; }</font></p>
<p>&nbsp;</p>
<p>And that&rsquo;s it!</p>
<p>&nbsp;</p>
<p>Most of you will know me as being a huge jQuery fan (and I&rsquo;m certain most of this work can be ported to the framework) but as a concept I thought it was very interesting that cross-browser client-side storage could be achieved <em>without </em>needing to use add-ons like Gears or have a browser following the latest trends in computing.</p>
<p>&nbsp;</p>
<p><a class="thickbox" href="http://blarnee.com/wp/wp-content/uploads/image19.png"><img width="354" height="247" border="0" title="image" style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" alt="image" src="http://blarnee.com/wp/wp-content/uploads/image_thumb18.png" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The methods I&rsquo;ve described above <em>already</em> work in FireFox, Chrome and even IE6!, so it&rsquo;s feasible for you to start using them <strong>today</strong>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>To <strong>download</strong> YUI with the above <strong>demo</strong> integrated into it, click <a href="http://www.addyosmani.com/resources/downloads/swfstore.rar">here</a>.</p>
<p>&nbsp;</p>
<p>Thanks and I hope this post was useful.</p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2Foffline-cross-browser-client-side-storage-for-the-web-using-javascript-and-a-little-flash%2F&amp;t=Offline%20Cross-Browser%20Client-Side%20Storage%20for%20the%20Web%20using%20JavaScript%20and%20a%20little%20Flash" id="facebook_share_button_610" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_610') || document.getElementById('facebook_share_icon_610') || document.getElementById('facebook_share_both_610') || document.getElementById('facebook_share_button_610');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_610') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/7-really-useful-tips-for-better-jquery-code/' rel='bookmark' title='Permanent Link: 7 Really Useful Tips For Better jQuery Code'>7 Really Useful Tips For Better jQuery Code</a> <small>&nbsp; I&rsquo;ve been using jQuery in my web apps for...</small></li><li><a href='http://blarnee.com/wp/get-back-more-storage-space-in-windows-vista-part-2/' rel='bookmark' title='Permanent Link: Get back more storage space in Windows Vista &#8211; Part 2'>Get back more storage space in Windows Vista &#8211; Part 2</a> <small>Windows Vista has a unique feature known as a shadow...</small></li><li><a href='http://blarnee.com/wp/web-workers-amazing-parallel-javascript-tasking-for-your-application/' rel='bookmark' title='Permanent Link: Web Workers &#8211; Amazing Parallel JavaScript Tasking For Your Application'>Web Workers &#8211; Amazing Parallel JavaScript Tasking For Your Application</a> <small>&#160; I’ve been looking at some of the cool new...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blarnee.com/wp/offline-cross-browser-client-side-storage-for-the-web-using-javascript-and-a-little-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open-Source JavaScript CoverFlow</title>
		<link>http://blarnee.com/wp/open-source-javascript-coverflow/</link>
		<comments>http://blarnee.com/wp/open-source-javascript-coverflow/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 06:37:51 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[coverflow]]></category>
		<category><![CDATA[coverflow demo]]></category>
		<category><![CDATA[coverflow effect]]></category>
		<category><![CDATA[coverflow itunes]]></category>
		<category><![CDATA[coverflow ui]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript coverflow]]></category>
		<category><![CDATA[javascript coverflow effect]]></category>
		<category><![CDATA[jcoverflow]]></category>
		<category><![CDATA[jquery coverflow]]></category>

		<guid isPermaLink="false">http://addyosmani.com/blog/open-source-javascript-coverflow/</guid>
		<description><![CDATA[&#160; &#160; Hi guys. I&#8217;m making some more of my custom components available for download today. The Apple iTunes CoverFlow effect is one the nicest forms of visualizing albums and images that I&#8217;ve seen over the past few years and I&#8217;ve always wondered..could the effect be done using JavaScript and no Flash whatsoever?. The answer [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/cflow-coverflow-for-jquery-experimental-release/' rel='bookmark' title='Permanent Link: cFlow &#8211; Coverflow for jQuery (Experimental Release)'>cFlow &#8211; Coverflow for jQuery (Experimental Release)</a> <small>&nbsp; &nbsp; Update:&nbsp;This component has been replaced by the more...</small></li><li><a href='http://blarnee.com/wp/an-improved-javascript-coverflow-demo-using-canvas-and-html5/' rel='bookmark' title='Permanent Link: An improved Javascript CoverFlow demo using Canvas and HTML5 (Firefox only)'>An improved Javascript CoverFlow demo using Canvas and HTML5 (Firefox only)</a> <small>&nbsp; Over the past 2 weeks I&#8217;ve done a lot...</small></li><li><a href='http://blarnee.com/wp/new-open-source-product-releases-rolling-out/' rel='bookmark' title='Permanent Link: New open-source product releases rolling out'>New open-source product releases rolling out</a> <small> Some of you may have noticed that the site...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><a class="thickbox" href="http://blarnee.com/wp/wp-content/uploads/cpreview.jpg"><img width="379" height="262" border="0" alt="cpreview" style="border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="cpreview" src="http://blarnee.com/wp/wp-content/uploads/cpreview_thumb.jpg" /></a></p>
<p>&nbsp;</p>
<p>Hi guys. I&#8217;m making some more of my custom components available for download today. The <a href="http://www.apple.com/">Apple</a> iTunes CoverFlow effect is one the nicest forms of visualizing albums and images that I&rsquo;ve seen over the past few years and I&rsquo;ve always wondered..could the effect be done using JavaScript and no Flash whatsoever?. The answer is yes and I&rsquo;d like to share with you my new Pure JavaScript CoverFlow component (which doesn&rsquo;t rely on jQuery, YUI or any other frameworks to work! :).&nbsp; <span id="more-544"></span></p>
<p>&nbsp;</p>
<p>The effect is made possible using the HTML5 Canvas element which takes care of all the image processing work (eg. reflections and tilts etc). I&#8217;ve seen previous implementations that use PHP to achieve this but I think a true implementation should be able to do all of this at the client side &#8211; hopefully my version lives up to that.</p>
<p>&nbsp;</p>
<p>For readers who haven&rsquo;t checked it out before, the CoverFlow includes keyboard navigation, one-click flip and tilt access to any item in the stack, a built-in lightbox for viewing higher resolution images, HTML album previews and much more.</p>
<p>&nbsp;</p>
<p>
With release 2.0.1 one of the important things that have been addressed is increased cross-browser compatibility with Google Chrome 2.0 +, FireFox 3.5 + and Safari 4.0 also now supported. The newest version of the component can be downloaded from SourceForge via the link below. Please feel free to share it and let me know what your thoughts are on it.</p>
<p>&nbsp;</p>
<p>Screencast:&nbsp; <a href="http://screenr.com/hQs">Watch this component in action right here</a></p>
<p>Demo:&nbsp; <a href="http://folio.vndv.com/jcoverflow/">Launch the FireFox/Chrome/Safari compatible demo here</a></p>
<p>Download: <a href="https://sourceforge.net/projects/jcoverflow/">Get the sources via SourceForge</a></p>
<p>New: You can also download an alternative version of the CoverFlow done using YUI right <a href="http://addyosmani.com/blog/wp-content/uploads/CoverFlow0_1.zip">here.</a></p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2Fopen-source-javascript-coverflow%2F&amp;t=Open-Source%20JavaScript%20CoverFlow" id="facebook_share_button_544" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_544') || document.getElementById('facebook_share_icon_544') || document.getElementById('facebook_share_both_544') || document.getElementById('facebook_share_button_544');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_544') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/cflow-coverflow-for-jquery-experimental-release/' rel='bookmark' title='Permanent Link: cFlow &#8211; Coverflow for jQuery (Experimental Release)'>cFlow &#8211; Coverflow for jQuery (Experimental Release)</a> <small>&nbsp; &nbsp; Update:&nbsp;This component has been replaced by the more...</small></li><li><a href='http://blarnee.com/wp/an-improved-javascript-coverflow-demo-using-canvas-and-html5/' rel='bookmark' title='Permanent Link: An improved Javascript CoverFlow demo using Canvas and HTML5 (Firefox only)'>An improved Javascript CoverFlow demo using Canvas and HTML5 (Firefox only)</a> <small>&nbsp; Over the past 2 weeks I&#8217;ve done a lot...</small></li><li><a href='http://blarnee.com/wp/new-open-source-product-releases-rolling-out/' rel='bookmark' title='Permanent Link: New open-source product releases rolling out'>New open-source product releases rolling out</a> <small> Some of you may have noticed that the site...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blarnee.com/wp/open-source-javascript-coverflow/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>21 Incredibly Useful Things You Can Do With cURL and PHP</title>
		<link>http://blarnee.com/wp/21-incredibly-useful-things-you-can-do-with-curl-and-php/</link>
		<comments>http://blarnee.com/wp/21-incredibly-useful-things-you-can-do-with-curl-and-php/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 03:49:51 +0000</pubDate>
		<dc:creator>legacye</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[cURL php]]></category>
		<category><![CDATA[curl php examples]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php mashups]]></category>
		<category><![CDATA[recent covers last.fm]]></category>
		<category><![CDATA[shorten url bitly]]></category>
		<category><![CDATA[todolist]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Tweeting]]></category>
		<category><![CDATA[twitter API]]></category>
		<category><![CDATA[update facebook status]]></category>
		<category><![CDATA[upload files amazon]]></category>

		<guid isPermaLink="false">http://addyosmani.com/blog/21-incredibly-useful-things-you-can-do-with-curl-and-php/</guid>
		<description><![CDATA[&#160; Like me, if you’ve ever wanted to use a Web Service from a site that doesn’t have that many code examples or a solid API, chances are you may have considered using cURL – a great extension to PHP that allows you to authenticate with websites just like a normal user would. The benefits [...]


Related posts:<ol><li><a href='http://blarnee.com/wp/15-amazing-things-you-can-do-using-curl/' rel='bookmark' title='Permanent Link: 15 amazing things you can do using cURL'>15 amazing things you can do using cURL</a> <small>If you&#8217;ve ever wanted to consume services from a popular...</small></li><li><a href='http://blarnee.com/wp/to-tweet-or-not-to-tweet-that-is-the-question/' rel='bookmark' title='Permanent Link: To tweet or not to tweet. That is the question.'>To tweet or not to tweet. That is the question.</a> <small> Lately, I&#8217;ve noticed that more and more people are...</small></li><li><a href='http://blarnee.com/wp/jquery-ui-animation-effects/' rel='bookmark' title='Permanent Link: jQuery UI Animation Effects'>jQuery UI Animation Effects</a> <small> The jQuery UI Effects Core brings a few more...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Like me, if you’ve ever wanted to use a Web Service from a site that doesn’t have that many code examples or a solid API, chances are you may have considered using <a href="http://www.php.net/curl">cURL</a> – a great extension to PHP that allows you to authenticate with websites just like a normal user would. The benefits of doing this are that you’re able to gain access to rich data sources like contact lists, email, statuses and a whole lot more. In this post I’m going to provide you with 20 code examples that’ll help you do some pretty cool things using everything from Bit.ly to Las.fm. Sites covered are Yahoo.com, Last.fm, Amazon, WordPress, Facebook, TwitPic, PayPal, Bit.ly, Twitter, GMail, MySpace, is.gd and IMDB.</p>
<p>  <span id="more-19"></span>
<p>&#160;</p>
<ol>
<li><a href="http://folio.vndv.com/scriptshare/shortenaurlwithbitly.txt">How to shorten a URL through bit.ly</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/gettrendingtopicsontwitter.txt">Get the trending topics on Twitter</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/getalbumtracks.txt">How to get the album covers of your most recent tracks on Last.fm</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/getyahoocontacts.txt">Get the list of your Yahoo Contacts via cURL</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/getyourlatesttweets.txt">How to get your very latest tweets</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/howtoupdateyourtwitter.txt">How to update your Twitter Status</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/howtouploadtofacebookvideo.txt">How to upload files to Facebook</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/importgmailcontacts.txt">How to import your GMail Contacts</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/s3php5.rar.gz">Upload files using Amazon S3 and PHP</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/logintomyspace.txt">How to login to mySpace through cURL</a> </li>
<li><a href="http://code.google.com/intl/de-DE/apis/youtube/1.0/developers_guide_php.html#UploadingVideos">How to upload videos to YouTube (API reference)</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/makeaposttowordpress.txt">How to make a post to WordPress</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/parsedetailsimdb.txt">How to parse out a movie&#8217;s details using IMDB</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/scrapebingdotcom.txt">How to Scape Bing.com for Search Results</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/updateyourfacebookstatus.txt">How to update your Facebook status</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/uploadpicturetotwitpic.txt">How to upload a picture to TwitPic through cURL</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/paypalcakephp.rar">How to process Payments using PayPal, cURL and CakePHP</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/scobblelast.txt">Scrobble tracks to your Last.fm account using cURL</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/youtubedownloader.zip">How to download videos in any format from YouTube</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/getisgdurl.txt">How to shorten a URL using the is.gd Shortening service</a> </li>
<li><a href="http://folio.vndv.com/scriptshare/googlereader.txt">How to grab the number of subscribers from your Google Reader Account</a> </li>
</ol>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblarnee.com%2Fwp%2F21-incredibly-useful-things-you-can-do-with-curl-and-php%2F&amp;t=21%20Incredibly%20Useful%20Things%20You%20Can%20Do%20With%20cURL%20and%20PHP" id="facebook_share_button_19" style="font-size:11px; line-height:13px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; text-decoration:none; display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; margin: 5px 0; height:15px; border:1px solid #d8dfea; color: #3B5998; background: #fff url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif) no-repeat top right;">Share</a>
<script type="text/javascript">
var button = document.getElementById('facebook_share_link_19') || document.getElementById('facebook_share_icon_19') || document.getElementById('facebook_share_both_19') || document.getElementById('facebook_share_button_19');
if (button) {
	button.onclick = function(e) {
		var url = this.href.replace(/share\.php/, 'sharer.php');
		window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	}

	if (button.id === 'facebook_share_button_19') {
		button.onmouseover = function(){
			this.style.color='#fff';
			this.style.borderColor = '#295582';
			this.style.backgroundColor = '#3b5998';
		}
		button.onmouseout = function(){
			this.style.color = '#3b5998';
			this.style.borderColor = '#d8dfea';
			this.style.backgroundColor = '#fff';
		}
	}
}
</script>


<p>Related posts:<ol><li><a href='http://blarnee.com/wp/15-amazing-things-you-can-do-using-curl/' rel='bookmark' title='Permanent Link: 15 amazing things you can do using cURL'>15 amazing things you can do using cURL</a> <small>If you&#8217;ve ever wanted to consume services from a popular...</small></li><li><a href='http://blarnee.com/wp/to-tweet-or-not-to-tweet-that-is-the-question/' rel='bookmark' title='Permanent Link: To tweet or not to tweet. That is the question.'>To tweet or not to tweet. That is the question.</a> <small> Lately, I&#8217;ve noticed that more and more people are...</small></li><li><a href='http://blarnee.com/wp/jquery-ui-animation-effects/' rel='bookmark' title='Permanent Link: jQuery UI Animation Effects'>jQuery UI Animation Effects</a> <small> The jQuery UI Effects Core brings a few more...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blarnee.com/wp/21-incredibly-useful-things-you-can-do-with-curl-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
