<?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>giancarlospot - desarrollo web &#187; CSS</title>
	<atom:link href="http://www.giancarlospot.com/categoria/css/feed" rel="self" type="application/rss+xml" />
	<link>http://www.giancarlospot.com</link>
	<description></description>
	<lastBuildDate>Fri, 02 Jul 2010 18:16:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Un &#8220;auto height&#8221; cuando se usa float en css</title>
		<link>http://www.giancarlospot.com/css/un-auto-height-cuando-se-usa-un-float-con-css.html</link>
		<comments>http://www.giancarlospot.com/css/un-auto-height-cuando-se-usa-un-float-con-css.html#comments</comments>
		<pubDate>Mon, 31 May 2010 18:15:26 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[capas]]></category>
		<category><![CDATA[contenedor]]></category>
		<category><![CDATA[float]]></category>

		<guid isPermaLink="false">http://www.giancarlospot.com/?p=335</guid>
		<description><![CDATA[Existen problemas cuando se está armando con capas y css una web, ya que muchas veces necesitamos tener una columna a la izquierda de la otra. Para lograr esto, necesitamos poner los tamaños de anchos exactos para que no se mueva para abajo la capa que debe estar al costado, pero también se debe trabajar [...]]]></description>
			<content:encoded><![CDATA[<p>Existen problemas cuando se está armando con capas y css una web, ya que muchas veces necesitamos tener una columna a la izquierda de la otra. Para lograr esto, necesitamos poner los tamaños de anchos exactos para que no se mueva para abajo la capa que debe estar al costado, pero también se debe trabajar con una capa contenedora y esto es lo que a muchos les trae problemas cuando el alto de la capa  (height) es dinámico.<br />
<span id="more-335"></span>Para solucionar este inconveniente siempre debemos tener una capa contenedora, pero como no sabemos el alto que ésta debe tener, le debemos de poner</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
div.contenedor<span style="color: #00AA00;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>Así, la capa crecerá en base a las capas que estén adentro, aunque estas tengan la propiedad &#8220;float&#8221;. Veamos un ejemplo</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
div.contenedor<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">450px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.contenedor</span> div.izquierda<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FF0000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">:;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.contenedor</span> div.centro<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">280px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#0000FF</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>Por cierto, ven que utiizo herencia de capas, si no están muy familiarizados con el armado de CSS vean este link para <a href="http://www.giancarlospot.com/css/armado-web-con-capas-div-y-css-sin-tablas.html">armar sus página webs con CSS y DIVs</a></p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;div class=&quot;contenedor&quot;&gt;
     &lt;div class=&quot;izquierda&quot;&gt;
     &lt;p&gt;Izquierda&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;/div&gt;
     &lt;div class=&quot;centro&quot;&gt;
     &lt;p&gt;Centro&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;p&gt;&amp;nbsp;&lt;/p&gt;
     &lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>Al final van a ver que obtendrán este resultado, el cual no quieren:</p>
<div class="text-align: center;"><img src="http://www.giancarlospot.com/wp-content/uploads/2010/05/float1.jpg" alt="" title="Float 1" width="468" height="391" class="size-full wp-image-337" /></div>
<p>Pero si le agregan el atributo display al estilo &#8220;contenedor&#8221;, tendrán justamente lo que necesitan, que la capa contenedor crezca verticalmente como las que están dentro de él:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
div.contenedor<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">450px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>Aquí está lo que quieren</p>
<div class="text-align: center;"><img src="http://www.giancarlospot.com/wp-content/uploads/2010/05/float2.jpg" alt="" title="Float 2" width="468" height="391" class="alignnone size-full wp-image-338" /></div>
<p>¿Qué les pareció? ¿Les sirvió?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/css/un-auto-height-cuando-se-usa-un-float-con-css.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Acordion con JQuery y con el plugin Jquery easing</title>
		<link>http://www.giancarlospot.com/javascript/acordion-con-jquery-y-con-el-plugin-jquery-easing.html</link>
		<comments>http://www.giancarlospot.com/javascript/acordion-con-jquery-y-con-el-plugin-jquery-easing.html#comments</comments>
		<pubDate>Mon, 11 Jan 2010 04:24:57 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[acordion]]></category>
		<category><![CDATA[easing]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.giancarlospot.com/?p=284</guid>
		<description><![CDATA[El uso del acordion en las páginas webs de ahora son muy usados y es más simple de lo que uno se puede imaginar, sobre todo si lo usas con JQuery. En realidad qué es? Puede ser un &#60;div&#62; oculto que los muestras cuando le das clic a otro DIV, bueno yo uso DIVS pero [...]]]></description>
			<content:encoded><![CDATA[<p>El uso del acordion en las páginas webs de ahora son muy usados y es más simple de lo que uno se puede imaginar, sobre todo si lo usas con <a href="http://jquery.com/" target="_blank">JQuery</a>. En realidad qué es? Puede ser un &lt;div&gt; oculto que los muestras cuando le das clic a otro DIV, bueno yo uso DIVS pero puedes usar un <a href="http://www.w3.org/MarkUp/HTMLPlus/htmlplus_11.html" target="_blank">&lt;p&gt;</a> u otra etiqueta.<br />
<span id="more-284"></span>Primero creamos los div con la información. Vamos a ponerle un número para poder identificar más rápido los títulos y la información en base a al div en el que se encuentran.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;acordion&quot;&gt;
&nbsp;
&lt;div id=&quot;item_1&quot; class=&quot;item&quot;&gt;
&nbsp;
&lt;div id=&quot;titulo_1&quot; class=&quot;titulo&quot;&gt;Título 1&lt;/div&gt;
&nbsp;
&nbsp;
&lt;div id=&quot;info_1&quot; class=&quot;info&quot;&gt;Información 1&lt;/div&gt;
&lt;/div&gt;
&nbsp;
&nbsp;
&lt;div id=&quot;item_2&quot; class=&quot;item&quot;&gt;
&nbsp;
&lt;div id=&quot;titulo_2&quot; class=&quot;titulo&quot;&gt;Título 2&lt;/div&gt;
&nbsp;
&nbsp;
&lt;div id=&quot;info_2&quot; class=&quot;info&quot;&gt;Información 2&lt;/div&gt;
&lt;/div&gt;
&nbsp;
&nbsp;
&lt;div id=&quot;item_3&quot; class=&quot;item&quot;&gt;
&nbsp;
&lt;div id=&quot;titulo_3&quot; class=&quot;titulo&quot;&gt;Título 3&lt;/div&gt;
&nbsp;
&nbsp;
&lt;div id=&quot;info_3&quot; class=&quot;info&quot;&gt;Información 3&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>Hemos encerrado todo en un div con el estilo &#8220;acordion&#8221;, dentro hay grupos, agrupados por un div con el estilo &#8220;item&#8221; y dentro hay dos divs, el título (estilo &#8220;titulo&#8221;) y la información (estilo &#8220;info&#8221;). Vamos a darle estilo a estas capas.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div.acordion<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;Palatino Linotype&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Book Antiqua&quot;</span><span style="color: #00AA00;">,</span> Palatino<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.item</span> div.titulo<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FF6</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">13px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">21px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.item</span> div.info<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#69F</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Le hemos dado tamaño, tipografía, colores, bordes, etc. Esto lo puedes cambiar en base a los colores que quieras utilizar o la tipografía, sin que esto percuta con el funcionamiento. Ahora lo que se debe hacer es ocultar la información, para que solo sea mostrada cuando se le de clic al título, esto lo hacemos en el estilo &#8220;info&#8221;.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #6666ff;">.item</span> div.info<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#69F</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Ahora veamos el Javascript, yo llamo a los JS antes de cerrar la etiqueta BODY. Vamos a llamar al los JS jquery.js y jquery.easing.js. Además, cuando termine de cargar el documento vamos a hacer que el acordion funcione, para esto vamos a utilizar el método <a href="http://docs.jquery.com/Core/each">each</a> de Jquery. Esto lo utilizo para que se sepa cual es el título y la información de cada &#8220;item&#8221;.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script src=&quot;jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:0--&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.easing.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:1--&gt;&lt;/script&gt;
<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;&lt;!--</span>mce<span style="color: #339933;">:</span><span style="color: #CC0000;">2</span><span style="color: #339933;">--&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Luego recuperamos el titulo y la información por cada &#8220;item&#8221;, aquí es donde usamos el número que le pusimos a los divs. Cuando le demos clic al título, su info respectiva se mostrará o se ocultará dependiendo del caso.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">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;">&quot;div.acordion div.item&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</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: #003366; font-weight: bold;">var</span> num <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//RECUPERAMOS EL NÚMERO</span>
		<span style="color: #003366; font-weight: bold;">var</span> titulo <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;div#titulo_&quot;</span><span style="color: #339933;">+</span>num<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> info <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;div#info_&quot;</span><span style="color: #339933;">+</span>num<span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span>titulo<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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>info<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideToggle</span><span style="color: #009900;">&#40;</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: #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></pre></div></div>

<p>Como ven, hasta ahí ya funciona el acordio, ahora pongámosle el easing y tiempo, el tiempo es en milisegundos, osea cada 1000 es 1 segundo.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> tiempoAbrir <span style="color: #339933;">=</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">;</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;">&quot;div.acordion div.item&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</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: #003366; font-weight: bold;">var</span> num <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> titulo <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;div#titulo_&quot;</span><span style="color: #339933;">+</span>num<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> info <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;div#info_&quot;</span><span style="color: #339933;">+</span>num<span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span>titulo<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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>info<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideToggle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>duration<span style="color: #339933;">:</span> tiempoAbrir<span style="color: #339933;">,</span> easing<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;easeOutElastic&quot;</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: #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></pre></div></div>

<p>Si prueban hasta este punto, van a ver que cuando se abre uno no se cierra el otro. Para que no estén dos abiertos lo que se debe hacer es que cuando se abra uno se guarda en una variable el que está abierto, entonces si se le da clic a otro se cierra primero éste y luego se abre el otro.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> abierto<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> tiempoAbrir <span style="color: #339933;">=</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> tiempoCerrar <span style="color: #339933;">=</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">;</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;">&quot;div.acordion div.item&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</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: #003366; font-weight: bold;">var</span> num <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> titulo <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;div#titulo_&quot;</span><span style="color: #339933;">+</span>num<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> info <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;div#info_&quot;</span><span style="color: #339933;">+</span>num<span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span>titulo<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>abierto <span style="color: #339933;">==</span> info<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span>info<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>duration<span style="color: #339933;">:</span> tiempoCerrar<span style="color: #339933;">,</span> easing<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;easeInElastic&quot;</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: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> abierto <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
					$<span style="color: #009900;">&#40;</span>info<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>duration<span style="color: #339933;">:</span> tiempoAbrir<span style="color: #339933;">,</span> easing<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;easeOutElastic&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					abierto <span style="color: #339933;">=</span> info<span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
					$<span style="color: #009900;">&#40;</span>abierto<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>duration<span style="color: #339933;">:</span> tiempoCerrar<span style="color: #339933;">,</span> easing<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;easeInElastic&quot;</span><span style="color: #339933;">,</span> complete<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>info<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>duration<span style="color: #339933;">:</span> tiempoAbrir<span style="color: #339933;">,</span> easing<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;easeOutElastic&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						abierto <span style="color: #339933;">=</span> info<span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</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;">&#125;</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: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>El plugin jquery.easing.js tiene diferentes tipos de movimientos, los pueden ver en bajando el ejemplo</p>
<p><a href="http://www.giancarlospot.com/ejemplos/acordion-con-easing.html" target="_blank">Mira el ejemplo</a><br />
<a href="http://www.giancarlospot.com/descargas/acordion-con-easing.zip">Descarga el ejemplo</a></p>
<p>No olvides dejar tus comentarios</p>
]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/javascript/acordion-con-jquery-y-con-el-plugin-jquery-easing.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Armado web con capas (div) y CSS sin tablas</title>
		<link>http://www.giancarlospot.com/css/armado-web-con-capas-div-y-css-sin-tablas.html</link>
		<comments>http://www.giancarlospot.com/css/armado-web-con-capas-div-y-css-sin-tablas.html#comments</comments>
		<pubDate>Mon, 23 Feb 2009 20:14:51 +0000</pubDate>
		<dc:creator>giancarlo</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[armado]]></category>

		<guid isPermaLink="false">http://www.giancarlospot.com/?p=85</guid>
		<description><![CDATA[Antes, armaba todas las páginas con tablas pero ahora la tendencia a armar la web es con divs, además es mejor porque no existe la necesitad de crear tantas tablas y crear tanto código y ayuda al posicionamiento en los buscadores ya que no hay tanto código y las cosas son más claras de entender. [...]]]></description>
			<content:encoded><![CDATA[<p>Antes, armaba todas las páginas con tablas pero ahora la tendencia a armar la web es con divs, además es mejor porque no existe la necesitad de crear tantas tablas y crear tanto código y ayuda al posicionamiento en los buscadores ya que no hay tanto código y las cosas son más claras de entender. No es tan difícil como parece, al contrario. Veamos algunos ejemplos</p>
<p><span id="more-85"></span><br />
Vamos a armar la cabecera de una página:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;header&quot;&gt;
&lt;div class=&quot;logo&quot;&gt;&lt;img src=&quot;logo.png&quot; alt=&quot;Mi logo&quot; width=&quot;256&quot; height=&quot;256&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;links&quot;&gt;
&lt;div class=&quot;inicio&quot;&gt;Inicio&lt;/div&gt;
&lt;div class=&quot;mapa&quot;&gt;Mapa del Sitio&lt;/div&gt;
&lt;div class=&quot;contacto&quot;&gt;Contáctame&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>Esto quedaría así:</p>
<p><img class="alignnone size-full wp-image-122" title="Ejemplo 1" src="http://www.giancarlospot.com/wp-content/uploads/2009/02/ejemplo1_armado_divs1.jpg" alt="Ejemplo 1" width="150" height="164" /></p>
<p>Ok, pero cómo haría para que las cosas se muestren mejor? Probemos escribiendo código CSS.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">div.header<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">780px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">256px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">dotted</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.header</span> div.logo<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">256px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">256px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.header</span> div.links<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.header</span> div<span style="color: #6666ff;">.links</span> div<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">17px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">21px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.header</span> div<span style="color: #6666ff;">.links</span> div.inicio<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">inicio.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.header</span> div<span style="color: #6666ff;">.links</span> div.mapa<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">sitemap.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.header</span> div<span style="color: #6666ff;">.links</span> div.contacto<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">email.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Como ven todo el diseño cambió, pero no modificamos nada del XHTML<br />
<img class="alignnone size-full wp-image-127" title="Ejemplo 2" src="http://www.giancarlospot.com/wp-content/uploads/2009/02/ejemplo2_armado_divs.jpg" alt="Ejemplo 2" width="793" height="272" /></p>
<p>Lo bueno de trabajar así es que tienes el XHTML y según tus estilos todo cambia, así puedes crear diferentes CSS y poder cambiar el diseño de tu página web fácilmente.</p>
<p>Habrán visto que se utilizó<br />
<strong>&#8220;div.header div.logo&#8221;</strong><br />
Esto quiere decir que la propiedad que se le está poniendo es a un div que tenga como &#8220;class&#8221; &#8220;logo&#8221; y que este div esté dentro de otro que tenga el &#8220;class&#8221; &#8220;header&#8221;, a esto se le puede llamar herencia de estilos.</p>
<p><a href="http://www.giancarlospot.com/public_html/wp-content/uploads/armado_web_con_capas_y_CSS_sin_tablas.zip">Descargar ejemplo</a> | <a href="http://www.tejedoresdelweb.com/w/CSS" target="_blank">Un buen tutorial de CSS</a> | <a href="http://www.mancormedia.com/blog/2009/03/02/un-layout-simple-muy-simple/trackback/">Miren Mancormedia</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.giancarlospot.com/css/armado-web-con-capas-div-y-css-sin-tablas.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
