<?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>Codrops &#187; pause</title>
	<atom:link href="http://tympanus.net/codrops/tag/pause/feed/" rel="self" type="application/rss+xml" />
	<link>http://tympanus.net/codrops</link>
	<description>Useful resources and inspiration for creative minds</description>
	<lastBuildDate>Mon, 06 Feb 2012 07:30:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Pause and Play Effect with jQuery</title>
		<link>http://tympanus.net/codrops/2010/01/07/pause-and-play-effect-with-jquery/</link>
		<comments>http://tympanus.net/codrops/2010/01/07/pause-and-play-effect-with-jquery/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 16:32:34 +0000</pubDate>
		<dc:creator>cody</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[pause]]></category>
		<category><![CDATA[play]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=1137</guid>
		<description><![CDATA[View demoDownload source Here&#8217;s an effect based on the one used in fml to stop and pause an event. The idea is that when we click on the play/pause button or press the space button, an image (play or pause) appears and fades out. This effect is done using jQuery, which we use to animate [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1145" title="pausePlay" src="http://tympanus.net/codrops/wp-content/uploads/2010/01/pausePlay.png" alt="pausePlay" width="501" height="342" /></p>
<p><a class="demo" href="http://www.tympanus.net/PausePlay/" target="_blank">View demo</a><a class="download" href="http://www.tympanus.net/PausePlay/PausePlay.zip">Download source</a></p>
<p>Here&#8217;s an effect based on the one used in <a href="http://live.fmylife.com/" target="_blank">fml</a> to stop and pause an event. The idea is that when we click on the play/pause button or press the space button, an image (play or pause) appears and fades out. This effect is done using jQuery, which we use to animate the image enlarging and fading out.</p>
<p>The images used for this effect:</p>
<p><img class="alignnone size-thumbnail wp-image-1140" title="play" src="http://tympanus.net/codrops/wp-content/uploads/2010/01/play1-150x150.png" alt="play" width="150" height="150" /> <img class="alignnone size-thumbnail wp-image-1141" title="pause" src="http://tympanus.net/codrops/wp-content/uploads/2010/01/pause1-150x150.png" alt="pause" width="150" height="150" /></p>
<p>The CSS:</p>
<pre class="brush:css">.player img{
position:absolute;
top:50%;
left:50%;
margin-top:-50px;
margin-left:-50px;
}</pre>
<p>The HTML:</p>
<pre class="brush:xml">&lt;a id="playbutton"&gt;Pause / Play&lt;/a&gt;
&lt;div id="player"&gt;
    &lt;img id="play" src="images/play.png" width="100" height="100" style="display:none;"/&gt;
    &lt;img id="pause" src="images/pause.png" width="100" height="100" style="display:none;"/&gt;
&lt;/div&gt;</pre>
<p>The jQuery:</p>
<pre class="brush:js">$(function() {
$(document).keypress(function(e){
if ((e.which &amp;&amp; e.which == 32) || (e.keyCode &amp;&amp; e.keyCode == 32)) {
togglePlay();
return false;
} else {
return true;
}
});
$('#playbutton').click(function(){
togglePlay();
return false;
});

function togglePlay(){
var $elem = $('#player').children(':first');
$elem.stop()
.show()
.animate({'marginTop':'-175px','marginLeft':'-175px','width':'350px','height':'350px','opacity':'0'},function(){
$(this).css({'width':'100px','height':'100px','margin-left':'-50px','margin-top':'-50px','opacity':'1','display':'none'});
});
$elem.parent().append($elem);
}
});</pre>
<p><a class="demo" href="http://www.tympanus.net/PausePlay/" target="_blank">View demo</a><a class="download" href="http://www.tympanus.net/PausePlay/PausePlay.zip">Download source</a></p>
<p><div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div><br />
<br/><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2010/01/07/pause-and-play-effect-with-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  tympanus.net/codrops/tag/pause/feed/ ) in 0.20682 seconds, on Feb 7th, 2012 at 12:06 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 7th, 2012 at 1:06 pm UTC -->
