<?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>Stiod Blog &#187; Javascript</title>
	<atom:link href="http://blog.stiod.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stiod.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 22 Feb 2010 14:20:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ordenação de tabelas com jQuery</title>
		<link>http://blog.stiod.com/2009/11/12/ordenacao-de-tabelas-com-jquery/</link>
		<comments>http://blog.stiod.com/2009/11/12/ordenacao-de-tabelas-com-jquery/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 13:19:36 +0000</pubDate>
		<dc:creator>Gabriel Verta</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=698</guid>
		<description><![CDATA[Em mais um post de jQuery, venho apresentar-lhes o plugin tablesorter. Este plugin ordena as colunas de uma tabela a partir do clique no cabeçalho da mesma:

No código, basta adicionar o javascript e o css do tablesorter, além da biblioteca jquery:
&#160;
&#60;html&#62;
&#60;head&#62;
&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; href=&#34;tablesorter.css&#34; /&#62;
    &#60;script type=&#34;text/javascript&#34; src=&#34;jquery.js&#34;&#62;&#60;/script&#62;
    &#60;script [...]]]></description>
			<content:encoded><![CDATA[<p>Em mais um post de jQuery, venho apresentar-lhes o <a href="http://tablesorter.com/docs/" target="_blank">plugin tablesorter</a>. Este plugin ordena as colunas de uma tabela a partir do clique no cabeçalho da mesma:</p>
<p><iframe src="http://pub.stiod.com/jquery/tablesorter.html" style="width:500px; height:180px; border:0 none;" frameborder="0"></iframe></p>
<p>No código, basta adicionar o <a href="http://pub.stiod.com/jquery/js/jquery.tablesorter.js" target="_blank">javascript</a> e o <a href="http://pub.stiod.com/jquery/css/tablesorter.css" target="_blank">css</a> do tablesorter, além da biblioteca jquery:</p>
<pre class="xml">&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;html<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;head<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;tablesorter.css&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;jquery.js&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;jquery.tablesorter.js&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        $(function(){
             $('.tablesorter').tablesorter()
         })
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/head<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;body<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;table</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;tablesorter&quot;</span> <span style="color: #000066;">cellspacing</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;thead<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;th<span style="font-weight: bold; color: black;">&gt;</span></span></span>first name<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/th<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;th<span style="font-weight: bold; color: black;">&gt;</span></span></span>last name<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/th<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;th<span style="font-weight: bold; color: black;">&gt;</span></span></span>age<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/th<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;th<span style="font-weight: bold; color: black;">&gt;</span></span></span>total<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/th<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;th<span style="font-weight: bold; color: black;">&gt;</span></span></span>discount<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/th<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;th<span style="font-weight: bold; color: black;">&gt;</span></span></span>date<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/th<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/thead<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tbody<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>peter<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>parker<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>28<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>$9.99<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>20%<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>jul 6, 2006 8:14 am<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>john<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>hood<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>33<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>$19.99<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>25%<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>dec 10, 2002 5:14 am<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>clark<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>kent<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>18<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>$15.89<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>44%<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>jan 12, 2003 11:14 am<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>bruce<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>almighty<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>45<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>$153.19<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>44%<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>jan 18, 2001 9:12 am<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>bruce<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>evans<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>22<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>$13.19<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>11%<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;td<span style="font-weight: bold; color: black;">&gt;</span></span></span>jan 18, 2007 9:12 am<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/td<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tr<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tbody<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/table<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;body<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/html<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;</pre>
<p><br/><br />
<a href="http://tablesorter.com/docs/" target="_blank">Na documentação oficial</a> ainda, são listadas algumas das configurações possíveis, dentre as quais podemos destacar:</p>
<ul>
<li><a href="http://tablesorter.com/docs/example-option-sort-force.html" target="_blank">Forçar ordenação inicial</a></li>
<li><a href="http://tablesorter.com/docs/example-trigger-sort.html" target="_blank">Ordenar tabela com link fora dela</a></li>
<li><a href="http://tablesorter.com/docs/example-ajax.html" target="_blank">Adicionar conteúdo dinâmicamente a tabela com AJAX</a></li>
<li><a href="http://tablesorter.com/docs/example-parsers.html" target="_blank">É possível criar um parser para ordenar conteúdo com seu próprio critério</a></li>
<li><a href="http://tablesorter.com/docs/example-pager.html" target="_blank">Integração com plugin de paginação</a></li>
</ul>
<p>É isso ai <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/11/12/ordenacao-de-tabelas-com-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Carrossel de imagens com jQuery</title>
		<link>http://blog.stiod.com/2009/11/05/carrossel-de-imagens-com-jquery/</link>
		<comments>http://blog.stiod.com/2009/11/05/carrossel-de-imagens-com-jquery/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 13:46:50 +0000</pubDate>
		<dc:creator>Gabriel Verta</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=679</guid>
		<description><![CDATA[Neste post venho mostrar-lhes outro bom plugin para jQuery, o jCarousel.
Com este plugin podemos fazer com que diversas imagens rodem em um espaço limitado tornando o layout mais amigável.
Vamos ao nosso primeiro exemplo de carrossel:



Para fazer um carrossel simples, como este, precisaremos dos arquivos de js e css da biblioteca jCarousel, além do css de [...]]]></description>
			<content:encoded><![CDATA[<p>Neste post venho mostrar-lhes outro bom plugin para jQuery, o <a href="http://sorgalla.com/projects/jcarousel/" target="_blank">jCarousel</a>.<br />
Com este plugin podemos fazer com que diversas imagens rodem em um espaço limitado tornando o layout mais amigável.</p>
<p>Vamos ao nosso primeiro exemplo de carrossel:</p>
<p style="text-align:center;">
<iframe src="http://pub.stiod.com/jquery/carrossel.html" style="width:430px; height:200px;"></iframe>
</p>
<p>Para fazer um carrossel simples, como este, precisaremos dos arquivos de js e css da biblioteca jCarousel, além do css de skin do jCarousel a ser utilizado, e do js do jQuery. Segue o código:</p>
<pre class="xml">&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;html<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;head<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;title<span style="font-weight: bold; color: black;">&gt;</span></span></span>Carrossel simples com jQuery<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/title<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/style.css&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/jcarousel.css&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/tango-skin.css&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;js/jquery.js&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;js/jcarousel.js&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
$(function(){
    $('#carrossel').jcarousel()
})
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/head<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;body<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;h1<span style="font-weight: bold; color: black;">&gt;</span></span></span>jCarousel - Carrosel Simples<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/h1<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ul</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;carrossel&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;jcarousel-skin-tango&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem1.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem2.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem3.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem4.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem5.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;li<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;img/imagem6.jpg&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/li<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ul<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/body<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/html<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;</pre>
<p><br/><br />
Este é o exemplo mais simples de utilização do jCarousel, existem várias outras variações deste através de opções passadas a ele. Dentre as funcionalidades podemos destacar:</p>
<ul>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/static_vertical.html" target="_blank">Carrossel Vertical</a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/static_auto.html" target="_blank">Carrossel com scroll automático</a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/static_controls.html" target="_blank">Carrosel com controles estáticos </a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/dynamic_flickr_api.html" target="_blank">Carrossel com conteúdo dinâmico via AJAX utilizando a API do Flickr</a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/special_textscroller.html" target="_blank">Scroll de Textos</a></li>
<li><a href="http://sorgalla.com/projects/jcarousel/examples/special_thickbox.html" target="_blank">Carrossel e Thickbox (clique na imagem do carrossel)</a></li>
</ul>
<p> <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/11/05/carrossel-de-imagens-com-jquery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Slide de Imagens com jQuery</title>
		<link>http://blog.stiod.com/2009/10/26/slide-de-imagens-jquery/</link>
		<comments>http://blog.stiod.com/2009/10/26/slide-de-imagens-jquery/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 14:44:38 +0000</pubDate>
		<dc:creator>Ricardo Perez</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=420</guid>
		<description><![CDATA[Continuando a série de post sobre jQuery iniciado por Gabriel.
Hoje vou mostrar um pouco sobre Effects e alguns métodos interessantes do jQuery, Usando como exemplo um simples slide de Imagem.
Neste código vemos o effect FadeIn(efeito de aparecer) e fadeOut(efeito de desaparecer) e o método next

&#160;
function slidein&#40;&#41;&#123;
    active_img = $&#40;&#34;.active&#34;&#41;;
    [...]]]></description>
			<content:encoded><![CDATA[<p>Continuando a série de post sobre jQuery iniciado por Gabriel.</p>
<p>Hoje vou mostrar um pouco sobre <a href="http://docs.jquery.com/Effects" target="_blank">Effects</a> e alguns métodos interessantes do jQuery, Usando como exemplo um simples slide de Imagem.</p>
<p>Neste código vemos o effect <i>FadeIn</i>(efeito de aparecer) e <i>fadeOut</i>(efeito de desaparecer) e o método <i>next</i><br />
<span id="more-420"></span></p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> slidein<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    active_img = $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;.active&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #009900; font-style: italic;">//O método next pega o próximo objeto,  dentro do div #slide-img</span>
    next_img =active_img.<span style="color: #006600;">next</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #009900; font-style: italic;">// verifica se existe um próximo objeto no div #slide-img</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>next_img.<span style="color: #006600;">length</span>==<span style="color: #CC0000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
            <span style="color: #009900; font-style: italic;">//se não tem um próximo objeto retorna pro primeiro</span>
            next_img = $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;.first-active&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    active_img.<span style="color: #006600;">fadeOut</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #66cc66;">&#41;</span>;
    active_img.<span style="color: #006600;">removeClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    next_img.<span style="color: #006600;">fadeIn</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #66cc66;">&#41;</span>;
    next_img.<span style="color: #006600;">addClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
$<span style="color: #66cc66;">&#40;</span>document<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">ready</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
setInterval<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;slidein()&quot;</span>, <span style="color: #3366CC;">&quot;3500&quot;</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#41;</span>
&nbsp;</pre>
<p><br/><br />
O HTML para o slide de imagem deve ser o seguinte:</p>
<pre>&nbsp;
&lt;div id=&quot;slide-img&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;active first-active&quot;&gt;&lt;img src=&quot;img1.jpg&quot;/&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;img2.jpg&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src=&quot;img3.jpg&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&nbsp;</pre>
<p><br/><br />
Antes coloque esse trecho de CSS:</p>
<pre class="css">&nbsp;
<span style="color: #cc00cc;">#slide-img</span> <span style="color: #66cc66;">&#123;</span>
    float<span style="color: #3333ff;">:left</span>;
    height<span style="color: #3333ff;">:xxx</span> <span style="color: #993333;">px</span>;<span style="color: #808080; font-style: italic;">/* a largura padrão das imgs dentro do slide*/</span>
    overflow<span style="color: #3333ff;">:hidden</span>;
    width<span style="color: #3333ff;">:yyy</span> <span style="color: #993333;">px</span>;<span style="color: #808080; font-style: italic;">/* o altura padrão das imgs dentro do slide*/</span>;
<span style="color: #66cc66;">&#125;</span>
* <span style="color: #66cc66;">&#123;</span>
    margin<span style="color: #3333ff;">:<span style="color: #933;">0</span></span>;
    padding<span style="color: #3333ff;">:<span style="color: #933;">0</span></span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p></br><br />
</br><br />
Veja o exemplo aqui:<br />
<iframe src="http://pub.stiod.com/slides.html"  style="height: 300px; width: 500px;" frameborder="0" border="0"></iframe></p>
<p><br/><br/><br />
<em>O ideal que o tamanho das imagens dentro do slide sejam as mesmas</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/26/slide-de-imagens-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bordas arredondadas com jQuery</title>
		<link>http://blog.stiod.com/2009/10/22/bordas-arredondadas-com-jquery/</link>
		<comments>http://blog.stiod.com/2009/10/22/bordas-arredondadas-com-jquery/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 16:25:21 +0000</pubDate>
		<dc:creator>Gabriel Verta</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=557</guid>
		<description><![CDATA[Pulando um pouco a seqüência de posts anteriores, gostaria de mostrar-lhes o plugin Jquery Corner que cria bordas arredondas com o JQuery.
E como funciona?

Para adicionar bordas arredondas basta você adicionar a biblioteca do jquery na sua página e o arquivo js do plugin:
&#160;
&#60;html&#62;
&#60;head&#62;
&#60;title&#62;JQuery Corner&#60;/title&#62;
// Jquery
&#60;script src=&#34;jquery.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
// JQuery Corner
&#60;script src=&#34;jquery.corner.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
&#60;script type=&#34;text/javascript&#34;&#62;
$(function(){    [...]]]></description>
			<content:encoded><![CDATA[<p>Pulando um pouco a seqüência de posts anteriores, gostaria de mostrar-lhes o plugin <a href="http://www.malsup.com/jquery/corner/">Jquery Corner</a> que cria bordas arredondas com o JQuery.</p>
<p><strong>E como funciona?</strong></p>
<p><span id="more-557"></span></p>
<p>Para adicionar bordas arredondas basta você adicionar a biblioteca do jquery na sua página e o <a href="http://www.malsup.com/jquery/corner/jquery.corner.js">arquivo js</a> do plugin:</p>
<pre>&nbsp;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;JQuery Corner&lt;/title&gt;
// Jquery
&lt;script src=&quot;jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
// JQuery Corner
&lt;script src=&quot;jquery.corner.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){     
    // Arredonda a borda do elemento com id borda-arredondada
    $('#borda-arredondada').corner() 
})
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;borda-arredondada&quot;&gt;
Lorem ipsum dolor sit amet
&lt;/div&gt;
&nbsp;
&lt;/body&gt;
&lt;/html&gt;
&nbsp;</pre>
<p><br/>Segue o exemplo:<br />
<iframe src="http://pub.stiod.com/jquery/jquery-corner.html" frameborder="0" border="0" style="height:220px;width:100%;"></iframe><br />
<br/></p>
<p>
Você ainda pode passar parâmetros para colocar bordas com certo tamanho de arredondamento, ou somente no topo, em baixo, ou outras "formas de arredondamento":</p>
<pre>&nbsp;
// Borda de 30px em todas as pontas
$(&quot;#borda-arredondada').corner('30px')
// Somente no topo
$(&quot;#borda-arredondada').corner('top')
// Somente em baixo
$(&quot;#borda-arredondada').corner('bottom')
// Somente no topo direito (tr = top + right)
$(&quot;#borda-arredondada').corner('tr')
// Bevel
$(&quot;#borda-arredondada').corner('bevel')
&nbsp;</pre>
<p><br/><br />
Outros exemplos podem ser vistos no site <a href="http://www.malsup.com/jquery/corner/">http://www.malsup.com/jquery/corner/</a>.<br />
<br/><br />
É isso ai <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/22/bordas-arredondadas-com-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>O objeto JQuery e seus seletores</title>
		<link>http://blog.stiod.com/2009/10/09/o-objeto-jquery-e-seus-seletores/</link>
		<comments>http://blog.stiod.com/2009/10/09/o-objeto-jquery-e-seus-seletores/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 13:24:01 +0000</pubDate>
		<dc:creator>Gabriel Verta</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript jquery xhtml]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=380</guid>
		<description><![CDATA[Continuando o post anterior sobre jQuery, iremos descrever o objeto jQuery.
A maioria das funcionalidades do jQuery é iniciada pela objeto $. O $ no jQuery possui diversas funcionalidades, que podem ser:
- Obtenção de objetos a partir de seletores.
Ex.: Obtendo todos os objetos que contenham a classe "dinamico":
alert($(".dinamico").length)
- "Window onload" (funções que irão ser executadas após [...]]]></description>
			<content:encoded><![CDATA[<p>Continuando o <a href="/2009/09/21/jquery-introducao-a-biblioteca-javascript/">post anterior</a> sobre jQuery, iremos descrever o objeto jQuery.<br />
A maioria das funcionalidades do jQuery é iniciada pela objeto $. O $ no jQuery possui diversas funcionalidades, que podem ser:</p>
<p><strong>- Obtenção de objetos a partir de seletores.</strong><br />
Ex.: Obtendo todos os objetos que contenham a classe "dinamico":<br />
<code>alert($(".dinamico").length)</code></p>
<p><strong>- "Window onload" (funções que irão ser executadas após o término do carregamento da página).</strong><br />
Ex.: Executando função com mensagem simples:<br />
<code>$(function(){<br />
alert("A página já carregou!")<br />
})</code></p>
<p><strong>- Funções úteis (<em>a serem descritas em um próximo post</em>).</strong><br />
Ex.: Removendo espaços do final e começo de uma string:<br />
<code>alert($.trim("              texto             ").length)</code></p>
<p><strong>- Ajax</strong><br />
Ex.: Requisição ajax por get<br />
<code>$.get("exemplo-ajax.php", function(resposta){<br />
alert(resposta)<br />
})</code></p>
<p><strong>- Criar conteúdo dinâmicamente</strong><br />
Ex.: Adicionando um novo paragrafo ao corpo da página:<br />
<code>$('&lt;p&gt;Novo Paragrafo&lt;/p&gt;').appendTo(document.body)</code></p>
<p><strong>Seletores</strong></p>
<p>Seletores são declarações que igualam um ou vários elementos do HTML. São eles que mapeiam o HTML no css:</p>
<table style="width: 100%;" border="1" bordercolor="#000000">
<thead>
<tr>
<th>Seletor</th>
<th>Descrição</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center"><strong>TAG</strong></td>
<td>Traz todos os elementos que sejam da TAG selecionada.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">alert($('p').length)</code></td>
</tr>
<tr>
<td align="center"><strong>#ID</strong></td>
<td>Traz o elemento que tenha o ID selecionado.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">$('#conteudo').css('background-color', '#ccc')</code></td>
</tr>
<tr>
<td align="center"><strong>.CLASSE</strong></td>
<td>Traz todos os elementos que tenham a CLASSE selecionada.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">$('.content-center').css('text-align', 'center')</code></td>
</tr>
<tr>
<td align="center"><strong>[PROPRIEDADE=VALOR]</strong></td>
<td>Traz todos os elementos que tenham a PROPRIEDADE com o VALOR selecionado.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">$('[name=nome]').val('Gabriel Verta')</code></td>
</tr>
<tr>
<td align="center"><strong>SELETOR1 SELETOR2</strong></td>
<td>Traz todos os elementos que SELETOR2 que estejem dentro do SELETOR1.<br />
<strong>Ex.:</strong><br />
<code style="width: 330px;">$('div label').addClass('required')</code></td>
</tr>
</tbody>
</table>
<p><br/><br />
Existe uma lista extensa de seletores para jQuery, que podem ser vistas na <a href="http://docs.jquery.com/Selectors" target="_blank">documentação oficial do jQuery</a>. Tentei criar um site com uma <a href="http://gabrielverta.com/jquery/index.html" target="_blank">forma dinâmica de ver estes seletores em jQuery</a>, espero que entendam como funciona o site. <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/10/09/o-objeto-jquery-e-seus-seletores/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Funções com argumentos variáveis em Javascript</title>
		<link>http://blog.stiod.com/2009/09/28/funcoes-com-argumentos-variaveis-em-javascript/</link>
		<comments>http://blog.stiod.com/2009/09/28/funcoes-com-argumentos-variaveis-em-javascript/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 14:41:03 +0000</pubDate>
		<dc:creator>Yoshio Iwamoto</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=400</guid>
		<description><![CDATA[Talvez você já tenha se deparado em uma situação onde precisava de uma ou mais funções em Javascript com o mesmo nome, porém com listas de argumentos diferentes ou com um argumento com um valor padrão.
Pois é, isso não existe em Javascript, pelo menos não como outras linguagens normalmente implementam. Um das formas de resolver [...]]]></description>
			<content:encoded><![CDATA[<p>Talvez você já tenha se deparado em uma situação onde precisava de uma ou mais funções em Javascript com o mesmo nome, porém com listas de argumentos diferentes ou com um argumento com um valor padrão.</p>
<p>Pois é, isso não existe em Javascript, pelo menos não como outras linguagens normalmente implementam. Um das formas de resolver este problema é utilizando a propriedade <em>arguments</em> das funções.</p>
<p><strong>Propriedade <em>arguments</em></strong></p>
<p><em>arguments</em> é uma propriedade que contém os argumentos passados para a função. Ele só pode ser chamado localmente e pode ser utilizado como um array.</p>
<p><strong>Propriedades:</strong><br />
<code><em>Function.arguments.length</em>: Quantidade de argumentos declarados.<br />
<em>arguments.length</em>: Quantidade real de argumentos.<br />
<em>arguments.callee</em>: Referência para função.</code></p>
<p>Lembre-se que o <em>arguments</em> deve ser utilizado de dentro da função. Aqui vão alguns exemplos para deixar as coisas mais claras.</p>
<p><em>Você pode passar quantos argumentos quiser sem precisar declara-los na função:</em></p>
<pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> myfunc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    a = arguments<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #66cc66;">&#93;</span>;
    b = arguments<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#93;</span>;
    c = arguments<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #66cc66;">&#93;</span>;
    <span style="color: #009900; font-style: italic;">// ...</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
myfunc<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">1</span>, <span style="color: #CC0000;">2</span>, <span style="color: #CC0000;">3</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p><em>Um meio de se indicar um valor padrão para um argumento que não é passado:</em></p>
<pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> myfunc<span style="color: #66cc66;">&#40;</span>a, b<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> c = <span style="color: #CC0000;">3</span>;
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>arguments.<span style="color: #006600;">length</span> == <span style="color: #CC0000;">3</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        c = arguments<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #66cc66;">&#93;</span>;
    <span style="color: #66cc66;">&#125;</span>
    <span style="color: #009900; font-style: italic;">/*
    ou
    var c = arguments.length == 3 ? arguments[2] : 3;
    */</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
myfunc<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">1</span>, <span style="color: #CC0000;">2</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">/* ou */</span>
&nbsp;
myfunc<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">1</span>, <span style="color: #CC0000;">2</span>, <span style="color: #CC0000;">3</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p><em>Verificando a quantidade de argumentos passados com os permitidos:</em></p>
<pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> myfunc<span style="color: #66cc66;">&#40;</span>a, b<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>arguments.<span style="color: #006600;">length</span> != myfunc.<span style="color: #006600;">arguments</span>.<span style="color: #006600;">length</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'Passe 2 argumentos!'</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
    <span style="color: #009900; font-style: italic;">// ...</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
myfunc<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// exibe 'Passe 2 argumentos!'</span>
&nbsp;
<span style="color: #009900; font-style: italic;">/* ou */</span>
&nbsp;
myfunc<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">1</span>, <span style="color: #CC0000;">2</span>, <span style="color: #CC0000;">3</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// exibe 'Passe 2 argumentos!'</span>
&nbsp;</pre>
<p><em>O callee pode ser utilizado em recursões onde não se conhece o nome da função, como as funções anônimas:</em></p>
<pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> myfunc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>a &gt; <span style="color: #CC0000;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> a;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">return</span> arguments.<span style="color: #006600;">callee</span><span style="color: #66cc66;">&#40;</span>a + <span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
    <span style="color: #009900; font-style: italic;">// ...</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
myfunc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/09/28/funcoes-com-argumentos-variaveis-em-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery &#8211; Introdução a biblioteca Javascript</title>
		<link>http://blog.stiod.com/2009/09/21/jquery-introducao-a-biblioteca-javascript/</link>
		<comments>http://blog.stiod.com/2009/09/21/jquery-introducao-a-biblioteca-javascript/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 16:15:12 +0000</pubDate>
		<dc:creator>Gabriel Verta</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=357</guid>
		<description><![CDATA[Introdução
JQuery é uma biblioteca Javascript que tem como objetivo simplificar o tratamento javascript em uma página HTML, ou seja, tornar mais fácil o tratamento de eventos, animações, requisições Ajax... Muito utilizada no mercado devido a facilidade de uso e de extensão, onde os diversos programadores que a utilizam criam plugins para as mais variadas atividades, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introdução</strong><br />
<a href="http://jquery.com/">JQuery</a> é uma biblioteca Javascript que tem como objetivo simplificar o tratamento javascript em uma página HTML, ou seja, tornar mais fácil o tratamento de eventos, animações, requisições <a href="http://pt.wikipedia.org/wiki/AJAX_(programa%C3%A7%C3%A3o)">Ajax</a>... Muito utilizada no mercado devido a facilidade de uso e de extensão, onde os diversos programadores que a utilizam criam plugins para as mais variadas atividades, tais como <a href="http://sorgalla.com/projects/jcarousel/" target="_blank">slide de imagens</a>, <a href="http://digitalbush.com/projects/masked-input-plugin/" target="_blank">máscara para campos de formulário</a>, <a href="http://www.malsup.com/jquery/corner/" target="_blank">tornar bordas redondas</a> dentre outras...</p>
<p><strong>Como funciona?</strong><br />
Para utilizar a biblioteca basta adicionar o <a href="http://docs.jquery.com/Release:jQuery_1.3.2" target="_blank">arquivo Javascript do jQuery</a>:</p>
<pre>
&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>A última versão também pode ser encontrada em <a href="http://code.jquery.com/jquery-latest.js" target="_blank">http://code.jquery.com/jquery-latest.js</a></p>
<p><strong>Exemplo de utilização</strong><br />
Caso eu queira que todos os elementos que tenham a classe "dinamico" sejem ocultadas quando apertado o botão ocultar, eu teria o seguinte código dentro da função de ocultar:</p>
<p><code><br />
$('.dinamico').hide()<br />
</code></p>
<p>ou ainda, utilizando os efeitos do jQuery:</p>
<p><code><br />
$('.dinamico').fadeOut("slow")<br />
</code></p>
<p>Veja este <a href="http://pub.stiod.com/jquery/intro.html" target="_blank">exemplo funcionando</a>:<br />
<iframe src="http://pub.stiod.com/jquery/intro.html" border="0" style="border:0; width:400px; height:400px; overflow:hidden;" frameborder="0" scrolling="no"></iframe></p>
<p>No próximo post explicarei algumas funcionalidades do objeto jQuery e como funcionam os seletores.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2009/09/21/jquery-introducao-a-biblioteca-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Criando um Widget Panel com o framework javascript ExtJs</title>
		<link>http://blog.stiod.com/2008/11/28/criando-um-widget-panel-com-o-framework-javascript-extjs/</link>
		<comments>http://blog.stiod.com/2008/11/28/criando-um-widget-panel-com-o-framework-javascript-extjs/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 17:31:31 +0000</pubDate>
		<dc:creator>caio</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://blog.stiod.com/?p=172</guid>
		<description><![CDATA[Segue a segunda parte do tutorial de introdução ao framework do ExJs.
Vamos falar dos Widgets, que são aplicativos feitos com o Extjs para facilitar o desenvolvimento das aplicações web.
E pra começar crie um arquivo HTML [não esqueça de baixar os fontes do ExtJs] e :
No HEAD do arquivo HTML referencie os arquivos script e de [...]]]></description>
			<content:encoded><![CDATA[<p>Segue a segunda parte do tutorial de introdução ao <a href="http://blog.stiod.com/2008/10/30/introducao-a-biblioteca-extjs/">framework do ExJs</a>.</p>
<p>Vamos falar dos Widgets, que são aplicativos feitos com o Extjs para facilitar o desenvolvimento das aplicações web.</p>
<p>E pra começar crie um arquivo HTML [não esqueça de baixar os <a href="http://www.extjs.com/products/extjs/download.php" target="_blank">fontes do ExtJs</a>] e :<br />
No <strong>HEAD</strong> do arquivo HTML referencie os arquivos script e de formatação de estilo.</p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- CSS pegue o arquivo na pasta ext-2.2\resources\ --&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">&lt;link</span></a> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/ext-all.css&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Ext-base.js pegue o arquivo na pasta ext-2.2\adapter\ext\ --&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;js/ext-base.js&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Ext-all.js pegue o arquivo na pasta raiz ext-2.2\ --&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;js/ext-all.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
&nbsp;</pre>
<p>E insira no corpo do documento esses elementos:</p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;quadro-id&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;quadro-conteudo&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span&gt;</span></a></span>Conte<span style="color: #ddbb00;">&amp;uacute;</span>do<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
&nbsp;</pre>
<p>Coloquei essa formatação em um <strong>STYLE</strong> pra deixar os textos mais harmônicos e definir um tamanho para o quadro que irá gerar o <strong>Ext Panel</strong></p>
<pre class="css">&nbsp;
body<span style="color: #66cc66;">&#123;</span>
  font<span style="color: #3333ff;">:normal</span> <span style="color: #993333;">normal</span> <span style="color: #933;">12px</span>/<span style="color: #933;">1</span><span style="color: #6666ff;"><span style="color: #933;">.8em</span></span> arial, <span style="color: #ff0000;">'trebuchet ms'</span>, verdana;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #cc00cc;">#quadro-id</span><span style="color: #66cc66;">&#123;</span>
  width<span style="color: #3333ff;">:<span style="color: #933;">500px</span></span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Agora indo para a parte mais importante os Scripts:</p>
<pre class="javascript">&nbsp;
<span style="color: #009900; font-style: italic;">//Verificando se o ExtJs foi carregado</span>
Ext.<span style="color: #006600;">onReady</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #009900; font-style: italic;">//Instanciando um novo objeto do Extjs</span>
  <span style="color: #003366; font-weight: bold;">var</span> quadro = <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #006600;">Panel</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>
    title:<span style="color: #3366CC;">'meu quadro'</span>,
    <span style="color: #009900; font-style: italic;">//referenciando um objeto no corpo do HTML</span>
    renderTo:<span style="color: #3366CC;">'quadro-id'</span>,
    <span style="color: #009900; font-style: italic;">//tem a opção de ser expansível</span>
    collapsible:<span style="color: #003366; font-weight: bold;">true</span>,
    <span style="color: #009900; font-style: italic;">//Opção de ser arrastado, mas volta ao ponto original</span>
    <span style="color: #009900; font-style: italic;">//Necessita incluir as propriedades de Drag n' Drop</span>
    draggable:<span style="color: #003366; font-weight: bold;">true</span>,
    <span style="color: #009900; font-style: italic;">//icone de fechar,  precisa de programação pra interatividade</span>
    closable:<span style="color: #003366; font-weight: bold;">true</span>,
    <span style="color: #009900; font-style: italic;">//Inserção e programação dos botões do cabeçalho do PANEL</span>
    tools:<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span>
      id:<span style="color: #3366CC;">'help'</span>,
      handler:<span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
          Ext.<span style="color: #006600;">Msg</span>.<span style="color: #006600;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>
          width:<span style="color: #CC0000;">350</span>,
          title:<span style="color: #3366CC;">'titulo do texto de ajuda'</span>,
          msg:<span style="color: #3366CC;">'corpo do  quadro de ajuda'</span>
        <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>,<span style="color: #66cc66;">&#123;</span>
    id:<span style="color: #3366CC;">'close'</span>,
    handler:<span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
      Ext.<span style="color: #006600;">destroy</span><span style="color: #66cc66;">&#40;</span>quadro<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span>,
    <span style="color: #009900; font-style: italic;">// conteúdo a ser renderizado dentro do PANEL</span>
    contentEl:<span style="color: #3366CC;">'quadro-conteudo'</span>
  <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #009900; font-style: italic;">//Centralizando quadro no centro da tela</span>
  Ext.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;quadro-id&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">center</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>O <strong>Widget PANEL</strong> e seus elementos visuais podem ser customizados, os arquivos de imagens e css desse objeto estão separados na pasta RESOURCES com seu respectivo nome.</p>
<p>Bom.. é só isso <img src='http://blog.stiod.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Coloquei <a href="http://caio.stiod.com/extjs/panel/" target="_blank">esse exemplo</a> no nosso servidor pra quem quiser acessar e ver funcionando.</p>
<p>Abraços a todos e em seguinda colocarei mais funcionalidades do ExtJs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stiod.com/2008/11/28/criando-um-widget-panel-com-o-framework-javascript-extjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
