<?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>L Cardoso &#187; slideshow</title>
	<atom:link href="http://www.lcardoso.com/tag/slideshow/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lcardoso.com</link>
	<description>Desenvolvedor Web</description>
	<lastBuildDate>Wed, 08 Dec 2010 14:54:22 +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>Transição de imagens com Cycle jQuery</title>
		<link>http://www.lcardoso.com/2010/04/transicao-de-imagens-com-cycle-jquery/</link>
		<comments>http://www.lcardoso.com/2010/04/transicao-de-imagens-com-cycle-jquery/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 13:09:21 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[-]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[cycle]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://www.lcardoso.com/?p=36</guid>
		<description><![CDATA[Olá amigos, já faz um tempo que não posto nada aqui, bem, resolvi reativar o blog passando algumas dicas e tutoriais bem simples e de fácil implementação e modificação. Hoje vou mostrar um efeito muito legal em jQuery, muito utilizado em Slideshows e galeria de imagens, é a transição com o plugin Cycle. vamos lá [...]]]></description>
			<content:encoded><![CDATA[<p>Olá amigos,</p>
<p>já faz um tempo que não posto nada aqui, bem, resolvi reativar o blog passando algumas dicas e tutoriais bem simples e de fácil implementação e modificação.</p>
<p>Hoje vou mostrar um efeito muito legal em jQuery, muito utilizado em Slideshows e galeria de imagens, é a transição com o plugin <a href="http://plugins.jquery.com/project/cycle" target="_blank">Cycle</a>.</p>
<p><a href="http://www.lcardoso.com/wp-content/uploads/2010/04/fade.jpg"><img src="http://www.lcardoso.com/wp-content/uploads/2010/04/fade-150x150.jpg" alt="" title="Efeito Cycle" width="150" height="150" class="alignnone size-thumbnail wp-image-37" /></a></p>
<p>vamos lá</p>
<p>Primeiramente vamos acrescentar em nosso código a biblioteca jQuery, adicione a seguinte linha acima da tag </head> no topo da página:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;</span> <span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Abaixo dele vamos acrescentar o plugin cycle, você pode fazer o download dele clicando aqui</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;../../js/cycle.js&quot;</span> <span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Agora vamos montar nossa lista de imagens a serem exibidas conforme o código abaixo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;ul id=&quot;roda&quot;&gt;
  &lt;li&gt;&lt;img src=&quot;01.jpg&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;img src=&quot;02.jpg&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;img src=&quot;03.jpg&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div>

<p>Eu dei uma identificação &#8220;roda&#8221; para a lista, isso é importante para o código jQuery identificar onde será realizado o efeito. </p>
<p>Agora vamos completar nosso código com o jQuery. Na parte de cima da página, logo abaixo do plugin cycle, entre com o seguinte código:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
4
5
6
7
8
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>  
    $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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;">'ul#roda'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">cycle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>  
        <span style="color: #009900;">&#125;</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>  
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Esse código é o que vai fazer a transição de imagens acontecer.</p>
<p>O plugin cycle permite alguns efeitos diferentes, você pode incrementar o código para conseguir novas formas de transições e velocidade das mesmas.</p>
<p>Em um exemplo pratico e rápido, eu inclui apenas 2 linhas ao código, substitua o codigo acima por este:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>  
    $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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;">'ul#roda'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">cycle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>  
            fx<span style="color: #339933;">:</span><span style="color: #3366CC;">'shuffle'</span><span style="color: #339933;">,</span>  
            speed<span style="color: #339933;">:</span> <span style="color: #CC0000;">1000</span>  
        <span style="color: #009900;">&#125;</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>  
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Aqui eu acrescentei 2 linhas, a linha &#8220;fx:&#8217;shuffle&#8217;&#8221; que muda o efeito de transição das imagens e a linha &#8220;speed:1000&#8243; que muda a velocidade desta transição.</p>
<p>Eu disponibilizei um exemplo do efeito <a href="http://www.lcardoso.com/exemplo/cycle/exemplo.html" target="_blank">aqui</a></p>
<p>Para saber mais sobre este plugin, acesse o site oficial <a href="http://jquery.malsup.com/cycle/" target="_blank">aqui</a></p>
<p>Qualquer dúvida é só deixar um comentário abaixo, ok?<br />
Um abraço a todos.</p>
<!-- boo-widget start -->
          <script type="text/javascript">
            bb_keywords = "slideshow";
            bb_bid  = "40565";
            bb_lang = "pt-BR";
            bb_name = "custom";bb_limit = "7";bb_format = "bbc";
          </script>
          <script type="text/javascript" src="http://widgets.boo-box.com/javascripts/embed.js"></script>
          <!-- boo-widget end -->]]></content:encoded>
			<wfw:commentRss>http://www.lcardoso.com/2010/04/transicao-de-imagens-com-cycle-jquery/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

