<?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>2kBlog.net - Tutoriales web 2.0 &#187; jQuery</title>
	<atom:link href="http://2kblog.net/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://2kblog.net</link>
	<description>Diseño web 2.0, jQuery, twitter, tutoriales y un poco de programación y otras cosas interesantes de la red</description>
	<lastBuildDate>Tue, 15 Dec 2009 12:07:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Cambiar Opacidad con jQuery</title>
		<link>http://2kblog.net/cambiar-opacidad-con-jquery/</link>
		<comments>http://2kblog.net/cambiar-opacidad-con-jquery/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 09:22:42 +0000</pubDate>
		<dc:creator>Krato</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[2kblog]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[cambiar css]]></category>
		<category><![CDATA[cambiar opacidad]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[fácil]]></category>
		<category><![CDATA[jquery css]]></category>
		<category><![CDATA[opacidad]]></category>

		<guid isPermaLink="false">http://2kblog.net/?p=236</guid>
		<description><![CDATA[Con el framework jquery podemos aparte derelaizar cosas como slideshows, tabs (como ya hemos visto), juegos etc, podemos por ejemplo cambiar las propiedades de nuestro css.
En éste caso vamos a ver como podemos cambiar la opacidad de una image, un div o cualquier elemento del html de nuestra página. Y para ello, aparte de llamar [...]]]></description>
			<content:encoded><![CDATA[<p>Con el framework jquery podemos aparte derelaizar cosas como slideshows, tabs (como ya hemos visto), juegos etc, podemos por ejemplo cambiar las propiedades de nuestro css.</p>
<p>En éste caso vamos a ver como podemos cambiar la opacidad de una image, un div o cualquier elemento del html de nuestra página. Y para ello, aparte de llamar al framework de jQuery, deberemos usar la siguiente sintaxis.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'elemento'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;opacity&quot;</span><span style="color: #339933;">,</span> valor<span style="color: #009900;">&#41;</span></pre></div></div>

<ol>
<li>Recordad que podemos usar o la palabra clave jQuery o el dolar $</li>
<li>Elemento -&gt; Elemento a cambiar la opacidad</li>
<li>Valor _&gt; EL valor que quermos darle. 0 significa que elemento tiene la opacidad al 0% y 1 que la tiene al 100%</li>
</ol>
<p>En este ejemplo cambiaríamos la opacidad de todos las imágenes de nuestro html</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;opacity&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.7</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Pero si queremos que qude un poco más profesional, podemos por ejemplo jugar con las imágenes de nuestro html para que cuando estemos sobre ellas en vez de cambiar la opacidad de un modo brusco podemos usar el evento fadeTo para hacerlo de un modo más suave.</p>
<p>Pongamos un ejemplo:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 75px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">jQuery(&#8221;img&#8221;).hover(function(){</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 75px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">jQuery(this).fadeTo(&#8221;slow&#8221;, 1.0); // Cambia la opacidad al 100 %</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 75px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">},function(){</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 75px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">jQuery(this).fadeTo(&#8221;slow&#8221;, 0.5); // Cambia la opacidad al 50% cuando el ya no  tiene el foco</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 75px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">});</div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</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>
&nbsp;
    jQuery<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;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Cambia la opacidad al 100 %</span>
&nbsp;
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    jQuery<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;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Cambia la opacidad al 50% cuando</span>
                                  <span style="color: #006600; font-style: italic;">// ya no tiene el foco</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Este ejemplo hará que  todas las ímagenes de nuestro html cambien a opacidad 100% cuando estemos sobre alguna de ellas y cuando no cambiará al 50% y todo ello de como si fuera un efecto de transición.</p>
<p>Y ahora os toca jugar a vosotros  <img class="lmbbox_smileys_img" src="http://2kblog.net/wp-content/plugins/lmbbox-smileys/smileys/tb/bye.gif" alt=":bye_tb:" /></p>
<p>Os dejo un ejemplo simple para descargar y podais ver el efecto.</p>
<p style="text-align: center;"><a href="http://2kblog.net/wp-content/plugins/download-monitor/download.php?id=10" title="Descargado 40 veces"><img src="http://2kblog.net/DOWN.png" alt="Opacidad con jQuery" /></a></p>
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-wealth"><ul class="socials"><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://2kblog.net/cambiar-opacidad-con-jquery/&amp;title=Cambiar+Opacidad+con+jQuery" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://2kblog.net/cambiar-opacidad-con-jquery/&amp;title=Cambiar+Opacidad+con+jQuery" rel="nofollow" class="external" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://2kblog.net/cambiar-opacidad-con-jquery/&amp;title=Cambiar+Opacidad+con+jQuery" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://2kblog.net/cambiar-opacidad-con-jquery/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://2kblog.net/cambiar-opacidad-con-jquery/&amp;t=Cambiar+Opacidad+con+jQuery" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://2kblog.net/cambiar-opacidad-con-jquery/&amp;t=Cambiar+Opacidad+con+jQuery" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://twitter.com/home?status=Cambiar+Opacidad+con+jQuery+-+http://2kblog.net/236+(via+@DoctorAnonimous)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li class="sexy-mail"><a href="mailto:?subject=%22Cambiar%20Opacidad%20con%20jQuery%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Con%20el%20framework%20jquery%20podemos%20aparte%20derelaizar%20cosas%20como%20slideshows%2C%20tabs%20%28como%20ya%20hemos%20visto%29%2C%20juegos%20etc%2C%20podemos%20por%20ejemplo%20cambiar%20las%20propiedades%20de%20nuestro%20css.%0D%0A%0D%0AEn%20%C3%A9ste%20caso%20vamos%20a%20ver%20como%20podemos%20cambiar%20la%20opacidad%20de%20una%20image%2C%20un%20div%20o%20cualquier%20elemento%20del%20html%20de%20nuestra%20p%C3%A1%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://2kblog.net/cambiar-opacidad-con-jquery/" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://2kblog.net/cambiar-opacidad-con-jquery/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://2kblog.net/cambiar-opacidad-con-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Slideshow con jQuery</title>
		<link>http://2kblog.net/slideshow-con-jquery/</link>
		<comments>http://2kblog.net/slideshow-con-jquery/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 07:00:22 +0000</pubDate>
		<dc:creator>Krato</dc:creator>
				<category><![CDATA[VideoTutoriales]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://2kblog.net/?p=229</guid>
		<description><![CDATA[En este videotutorial os enseñaré como crear fácilmente un slideshow de imágens. Pronto la descarga del ejemplo. 


Ya podeis descargaros el ejemplo (Se me había olvidado subirlo, jeje)

Share this on del.icio.usDigg this!Stumble upon something good? Share it on StumbleUponShare this on TechnoratiPost this to MySpaceShare this on FacebookTweet This!Email this to a friend?Subscribe to the [...]]]></description>
			<content:encoded><![CDATA[<p>En este videotutorial os enseñaré como crear fácilmente un slideshow de imágens. Pronto la descarga del ejemplo. <img class="lmbbox_smileys_img" src="http://2kblog.net/wp-content/plugins/lmbbox-smileys/smileys/tb/thumbup.gif" alt=":thumbup_tb:" /></p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="322" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://blip.tv/play/g_5LgZa1HgI%2Em4v" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="322" src="http://blip.tv/play/g_5LgZa1HgI%2Em4v" allowfullscreen="true"></embed></object></p>
<p style="text-align: center;">
<p style="text-align: left;">Ya podeis descargaros el ejemplo (Se me había olvidado subirlo, jeje)</p>
<p style="text-align: center;"><a href="http://2kblog.net/wp-content/plugins/download-monitor/download.php?id=11" title="Descargado 20 veces"><img src="http://2kblog.net/DOWN.png" alt="SlideShow con jQuery" /></a></p>
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-wealth"><ul class="socials"><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://2kblog.net/slideshow-con-jquery/&amp;title=Slideshow+con+jQuery" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://2kblog.net/slideshow-con-jquery/&amp;title=Slideshow+con+jQuery" rel="nofollow" class="external" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://2kblog.net/slideshow-con-jquery/&amp;title=Slideshow+con+jQuery" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://2kblog.net/slideshow-con-jquery/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://2kblog.net/slideshow-con-jquery/&amp;t=Slideshow+con+jQuery" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://2kblog.net/slideshow-con-jquery/&amp;t=Slideshow+con+jQuery" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://twitter.com/home?status=Slideshow+con+jQuery+-+http://2kblog.net/229+(via+@DoctorAnonimous)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li class="sexy-mail"><a href="mailto:?subject=%22Slideshow%20con%20jQuery%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22En%20este%20videotutorial%20os%20ense%C3%B1ar%C3%A9%20como%20crear%20f%C3%A1cilmente%20un%20slideshow%20de%20im%C3%A1gens.%20Pronto%20la%20descarga%20del%20ejemplo.%20%3Athumbup_tb%3A%0D%0A%0D%0A%0D%0A%0D%0AYa%20podeis%20descargaros%20el%20ejemplo%20%28Se%20me%20hab%C3%ADa%20olvidado%20subirlo%2C%20jeje%29%0D%0A%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://2kblog.net/slideshow-con-jquery/" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://2kblog.net/slideshow-con-jquery/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://2kblog.net/slideshow-con-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Búsqueda al vuelo con jQuery</title>
		<link>http://2kblog.net/busqueda-al-vuelo-con-jquery/</link>
		<comments>http://2kblog.net/busqueda-al-vuelo-con-jquery/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 19:00:16 +0000</pubDate>
		<dc:creator>Krato</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[2kblog]]></category>
		<category><![CDATA[ajax search]]></category>
		<category><![CDATA[busca]]></category>
		<category><![CDATA[busca jQuery]]></category>
		<category><![CDATA[buscador ajax]]></category>
		<category><![CDATA[buscador al vuelo]]></category>
		<category><![CDATA[búsqueda jQuery]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[fly search]]></category>

		<guid isPermaLink="false">http://2kblog.net/?p=222</guid>
		<description><![CDATA[Con un sencillo script podremos incluir en nuestra página un buscador al vuelo del tetxo que ésta misma contenga.
Para éste tutorial utilizaremos un plugin externo que se encargará de resaltar el texto que le enviemos. Se trata del Highlight v3 para jQuery. Es muy fácil de usar y nosotros la vamos a utilizar para crear [...]]]></description>
			<content:encoded><![CDATA[<p>Con un sencillo script podremos incluir en nuestra página un buscador al vuelo del tetxo que ésta misma contenga.</p>
<p>Para éste tutorial utilizaremos un plugin externo que se encargará de resaltar el texto que le enviemos. Se trata del <a href="http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html" target="_blank">Highlight v3</a> para jQuery. Es muy fácil de usar y nosotros la vamos a utilizar para crear una búqueda &#8220;al vuelo&#8221; en nuestra página web mediante las herramientas que jQuery nos suministra.</p>
<p>En este caso vamos a crear un campo de texto y con el evnto <em>keyUp</em> de jQuery buscaremos en el texto.</p>
<p>El html de ejemplo es el siguiente:</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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Búsqueda al vuelo con jQuery<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;busca.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>&gt;</span>
.marca{ background-color: yellow}
&nbsp;
*{
margin:0;
padding:0;
}
&nbsp;
li {
	list-style-type:none;
	float:left;
	display:inline;
}
&nbsp;
p {clear:both; padding-top:30px;}
&nbsp;
#contenedor{
	margin:30px;
}
&nbsp;
#muestra {
	padding-left: 10px;
	font-weight:bold;
}
#bus {
	padding-left: 10px;
}
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;contenedor&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;textfield&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;texto&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bus&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>Texto buscado: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;muestra&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
  Esto es un ejemplo de &quot;búsqueda al vuelo&quot; mediante jQuery. Un sencillo ejemplo  que puedes descargar desde <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://2kblog.net&quot;</span>&gt;</span>2kblog.net<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>This is an Example of &quot;fly search&quot; with jQuery. An easy example that can be downloaded from <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://2kblog.net&quot;</span>&gt;</span>2kblog.net<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Este es el código js - This is the js code:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span><span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">code</span>&gt;</span>
$(document).ready(function(){						   
 	jQuery('#texto').keyup(function (e) {
&nbsp;
			$('body').quitamarca();
			q = $(&quot;#texto&quot;).val();
			if(q != &quot;&quot;) {$('body').marca(q);} else {$(&quot;#muestra&quot;).text(&quot; &quot;);}
	 });
});
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">code</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Bye<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Como veis lo único que cargo es el jQuery de google y el js que he hecho.</p>
<p>Ahora veamos el js que es lo con l0 que funciona la búsqueda:</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="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>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>
 	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#texto'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">quitamarca</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  q <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#texto&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>q <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">marca</span><span style="color: #009900;">&#40;</span>q<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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#muestra&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot; &quot;</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;">&#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></td></tr></table></div>

<p>Vamos a dividir el código:</p>
<ol>
<li>Le decimos que la función empieze cuando la tecla se levante con la función keyup. Si lo intentamos con el evento keypress no funcionará ya que la tecla que hayamos pulsado aún no se a añadido al campo de texto por lo que fallará. (He estado un buen rato para esa tontería jeje).</li>
<li>Le quitamos la marca (por si hay alguna). Esto hace que si borramos se actualice la búqueda.</li>
<li>Recogemos en la variable q el texto que hay en el campo con id=texto</li>
<li>Si el campo no tiene nada no busca el texto y resetea el span que muestra el texto que hemos buscado. Si existe algo lo marca. Esto es necesario por si borramos el campo que no falle el javascript y la página se quede colgando.</li>
</ol>
<p>Y ya tenemos nuestro buscador funcionando!</p>
<p>El css del ejemplo es muy simple pero bastante para ver como funciona <img class="lmbbox_smileys_img" src="http://2kblog.net/wp-content/plugins/lmbbox-smileys/smileys/ee/wink.gif" alt=";)" /></p>
<p>Descarga el ejemplo:</p>
<p style="text-align: center;"><a href="http://2kblog.net/wp-content/plugins/download-monitor/download.php?id=9" title="Descargado 32 veces"><img src="http://2kblog.net/DOWN.png" alt="Buscador al vuelo" /></a></p>
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-wealth"><ul class="socials"><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://2kblog.net/busqueda-al-vuelo-con-jquery/&amp;title=B%C3%BAsqueda+al+vuelo+con+jQuery" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://2kblog.net/busqueda-al-vuelo-con-jquery/&amp;title=B%C3%BAsqueda+al+vuelo+con+jQuery" rel="nofollow" class="external" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://2kblog.net/busqueda-al-vuelo-con-jquery/&amp;title=B%C3%BAsqueda+al+vuelo+con+jQuery" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://2kblog.net/busqueda-al-vuelo-con-jquery/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://2kblog.net/busqueda-al-vuelo-con-jquery/&amp;t=B%C3%BAsqueda+al+vuelo+con+jQuery" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://2kblog.net/busqueda-al-vuelo-con-jquery/&amp;t=B%C3%BAsqueda+al+vuelo+con+jQuery" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://twitter.com/home?status=B%C3%BAsqueda+al+vuelo+con+jQuery+-+http://2kblog.net/222+(via+@DoctorAnonimous)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li class="sexy-mail"><a href="mailto:?subject=%22B%C3%BAsqueda%20al%20vuelo%20con%20jQuery%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Con%20un%20sencillo%20script%20podremos%20incluir%20en%20nuestra%20p%C3%A1gina%20un%20buscador%20al%20vuelo%20del%20tetxo%20que%20%C3%A9sta%20misma%20contenga.%0D%0A%0D%0APara%20%C3%A9ste%20tutorial%20utilizaremos%20un%20plugin%20externo%20que%20se%20encargar%C3%A1%20de%20resaltar%20el%20texto%20que%20le%20enviemos.%20Se%20trata%20del%20Highlight%20v3%20para%20jQuery.%20Es%20muy%20f%C3%A1cil%20de%20usar%20y%20nosotros%20la%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://2kblog.net/busqueda-al-vuelo-con-jquery/" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://2kblog.net/busqueda-al-vuelo-con-jquery/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://2kblog.net/busqueda-al-vuelo-con-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tabs con jQuery? Fácil!</title>
		<link>http://2kblog.net/tabs-con-jquery-facil/</link>
		<comments>http://2kblog.net/tabs-con-jquery-facil/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 16:23:28 +0000</pubDate>
		<dc:creator>Krato</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[2kblog]]></category>
		<category><![CDATA[ajax jQuery]]></category>
		<category><![CDATA[ajax tabs]]></category>
		<category><![CDATA[ejemplo]]></category>
		<category><![CDATA[facil tabs]]></category>
		<category><![CDATA[jQuery fácil]]></category>
		<category><![CDATA[tabs jQuery tabs]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://2kblog.net/?p=207</guid>
		<description><![CDATA[Hay muchas formas de crear tabs en Ajax. Si buscas en google o cualquier otro buscador podrás encontrar cientos de opciones igual de válidas. Pero yo os voy a enseñar una manera fácil de hacerlo en tan solo 10 lineas de código. Además es funcional tanto en Chrome, Firefox, Opera, Safari e incluso Internet Explorer.
Vamos [...]]]></description>
			<content:encoded><![CDATA[<p>Hay muchas formas de crear tabs en Ajax. Si buscas en google o cualquier otro buscador podrás encontrar cientos de opciones igual de válidas. Pero yo os voy a enseñar una manera fácil de hacerlo en tan solo 10 lineas de código. Además es funcional tanto en Chrome, Firefox, Opera, Safari e incluso Internet Explorer.</p>
<p>Vamos a empezar por lo primero, el código html:</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="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> xml:<span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;es&quot;</span> <span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;es&quot;</span> &gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>jQUery Tabs - 2kblog.net<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tabs.css&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tabs.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
	jQuery(document).ready(function(){
		jQuery(&quot;#tabs&quot;).tabs();
	});
 <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tabs&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;misTabs&quot;</span>&gt;</span> 
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#blog&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;activa&quot;</span>&gt;</span>2kBlog<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span> 
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#tab1&quot;</span>&gt;</span>Tab1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span> 
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#tab2&quot;</span>&gt;</span>Tab 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span> 
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span> 	 
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;blog&quot;</span>&gt;</span>
    	Ejemplo 1         
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span> 
		Ejemplo 2
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span> 
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tab2&quot;</span>&gt;</span>
		Ejemplo 3
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span> 
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Vamos a desribir el código:</p>
<ol>
<li>Como siempre la llamada a jQuery alojada en google.</li>
<li>La llamada al css y al javascript que haremos</li>
<li>Para que funcione la función javascript deberemos tener una estructura igual a la mostrada en el ejmplo, es decir, un div general, dentro una lista y antes de cerrar el div general los distintos divs a los que llamaremos.</li>
<li>Para que el script funcione debemos llamarle mandandole la id del div general, en mi caso: <em><strong>#tabs</strong></em></li>
</ol>
<p>Ahora veamos el js de 10 lineas: (lo pongo comentado para que lo veais)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">fn</span>.<span style="color: #660066;">tabs</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  <span style="color: #006600; font-style: italic;">//Creamos la función</span>
	<span style="color: #003366; font-weight: bold;">var</span> elemento <span style="color: #339933;">=</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">//creamos una variable opara recoegr el elemento</span>
	jQuery<span style="color: #009900;">&#40;</span>elemento<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Escondemos todas menos el primer elemento</span>
	jQuery<span style="color: #009900;">&#40;</span>elemento<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul li a&quot;</span><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: #006600; font-style: italic;">//para cada elemento clicado</span>
		jQuery<span style="color: #009900;">&#40;</span>elemento<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul li a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'activa'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//le quitamos la clase por si la tiene activa</span>
		jQuery<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;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'activa'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Añadimos la clase al elemento pulsado</span>
		jQuery<span style="color: #009900;">&#40;</span>elemento<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//escondemos todos los divs</span>
		jQuery<span style="color: #009900;">&#40;</span> jQuery<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;">'href'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//mostramos el div al elemento que hemos pulsado</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Lo único que hay que señalar es que podemos cambiar el modo en que se muestra y la velocidad. En vez de <em>fadeIn</em> podemos usar slideDown o <em>slideToggle</em> o simplemente <em>show</em>. Y en cuanto a la velocidad podemos usar milisegundos, o poner &#8220;slow&#8221; para lento, &#8220;fast&#8221; para rápido o &#8220;normal&#8221; para normal. (recordad que si ponemos 3000 serán 3 segundos)</p>
<p>Un ejmplo de la función con el css del ejemplo:</p>
<p style="text-align: center;"><img class="size-full wp-image-211 aligncenter" title="jQuery tabs - Facil!" src="http://2kblog.net/wp-content/uploads/2009/07/tabs.jpg" alt="jQuery tabs - Facil!" width="489" height="434" longdesc="http://2kblog.net/wp-content/uploads/2009/07/tabs.jpg" /></p>
<p style="text-align: left;">Como podes ver podemos incluir texto o video o cualquier cosa que pensemos.</p>
<p style="text-align: left;">Podeis descargaros el ejemplo desde aquí:</p>
<p style="text-align: center;"><a href="http://2kblog.net/wp-content/plugins/download-monitor/download.php?id=8" title="Descargado 46 veces"><img src="http://2kblog.net/DOWN.png" alt="jQuery Tabs" /></a></p>
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-wealth"><ul class="socials"><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://2kblog.net/tabs-con-jquery-facil/&amp;title=Tabs+con+jQuery%3F+F%C3%A1cil%21" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://2kblog.net/tabs-con-jquery-facil/&amp;title=Tabs+con+jQuery%3F+F%C3%A1cil%21" rel="nofollow" class="external" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://2kblog.net/tabs-con-jquery-facil/&amp;title=Tabs+con+jQuery%3F+F%C3%A1cil%21" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://2kblog.net/tabs-con-jquery-facil/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://2kblog.net/tabs-con-jquery-facil/&amp;t=Tabs+con+jQuery%3F+F%C3%A1cil%21" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://2kblog.net/tabs-con-jquery-facil/&amp;t=Tabs+con+jQuery%3F+F%C3%A1cil%21" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://twitter.com/home?status=Tabs+con+jQuery%3F+F%C3%A1cil%21+-+http://2kblog.net/207+(via+@DoctorAnonimous)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li class="sexy-mail"><a href="mailto:?subject=%22Tabs%20con%20jQuery%3F%20F%C3%A1cil%21%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Hay%20muchas%20formas%20de%20crear%20tabs%20en%20Ajax.%20Si%20buscas%20en%20google%20o%20cualquier%20otro%20buscador%20podr%C3%A1s%20encontrar%20cientos%20de%20opciones%20igual%20de%20v%C3%A1lidas.%20Pero%20yo%20os%20voy%20a%20ense%C3%B1ar%20una%20manera%20f%C3%A1cil%20de%20hacerlo%20en%20tan%20solo%2010%20lineas%20de%20c%C3%B3digo.%20Adem%C3%A1s%20es%20funcional%20tanto%20en%20Chrome%2C%20Firefox%2C%20Opera%2C%20Safari%20e%20incl%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://2kblog.net/tabs-con-jquery-facil/" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://2kblog.net/tabs-con-jquery-facil/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://2kblog.net/tabs-con-jquery-facil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Menú en Acordeón en Ajax</title>
		<link>http://2kblog.net/menu-en-acordeon-en-ajax/</link>
		<comments>http://2kblog.net/menu-en-acordeon-en-ajax/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 17:21:58 +0000</pubDate>
		<dc:creator>Krato</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[2kblog]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[menu jQuery]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://2kblog.net/?p=149</guid>
		<description><![CDATA[Hoy veremos como crear un menu en forma de acordeón de forma sencilla tan solo con unos pocos pasos. Estos menus suelen estar en algún lateral de una web ya que se expenden o contraen de forma vertical. Éste ejemplo es muy sencillo aunque por supuesto también añadiré la descarga del archivo de ejemplo.
Bueno empecemos. [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy veremos como crear un menu en forma de acordeón de forma sencilla tan solo con unos pocos pasos. Estos menus suelen estar en algún lateral de una web ya que se expenden o contraen de forma vertical. Éste ejemplo es muy sencillo aunque por supuesto también añadiré la descarga del archivo de ejemplo.</p>
<p>Bueno empecemos. Lo primo que debemos de crear el html que se necesita para que el ejemplo funcione correctamente. Ya que seguimos trabajando con jQuery necesitamos como en los otros ejemplos llamarlo, y que mejor que google. El código html:</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
35
36
37
38
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;style.css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Menu en acordeón<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
	<span style="color: #808080; font-style: italic;">&lt;!--[if lt IE 8]&gt;</span>
<span style="color: #808080; font-style: italic;">   &lt;style type=&quot;text/css&quot;&gt;</span>
<span style="color: #808080; font-style: italic;">   li a {display:inline-block;}</span>
<span style="color: #808080; font-style: italic;">   li a {display:block;}</span>
<span style="color: #808080; font-style: italic;">   &lt;/style&gt;</span>
<span style="color: #808080; font-style: italic;">   &lt;![endif]--&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	 <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Menu 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- Un Menu  --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Submenu 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!-- Un SubMenu  --&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Submenu 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Menu 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Submenu 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Submenu 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.kratoweb.com&quot;</span>&gt;</span>Menu sin submenus<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Lo importante:<br />
El código en comentario es para que el ejemplo también funcione correctamente en Internet Explorer 8.</p>
<p>Como veis, debemos crear una lista no ordenada &lt;ul&gt; con el id <em>menu</em>. Y dentro de ese ul cada &lt;li&gt; será un menu <em>(linea 21)</em> y si dentro de cada &lt;li&gt; añadimos otra lista no ordenada con los items, estos serán los submenus <em>(linea 23)</em>.</p>
<p>Y ahora el archivo js:</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
</pre></td><td 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;">'#menu ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#menu ul:first'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#menu li a'</span><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: #003366; font-weight: bold;">var</span> elemento <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;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>elemento.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>elemento.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':visible'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		  elemento.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'normal'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>elemento.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>elemento.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':visible'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        elemento.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'normal'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><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;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Es fácil no?  Oculta las &lt;ul&gt;, muestra el pimer grupo de submenus para que quede uno ya activo, y por cada enlace que se pulsa muestra o esconde los submenus.</p>
<p>Tambión podemos cambiar la velocidad, poniendo por ejemplo los segundos que queremos que tarde:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">        elemento.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//4 segundos</span></pre></div></div>

<p>Aquí os dejo la descarga que incluye un simple css para que veais como queda con un estilo. Bye!</p>
<p style="text-align: center;"><a href="http://2kblog.net/wp-content/plugins/download-monitor/download.php?id=6" title="Descargado 495 veces"><img src="http://2kblog.net/DOWN.png" alt="Menú en acordeón" /></a></p>
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-wealth"><ul class="socials"><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://2kblog.net/menu-en-acordeon-en-ajax/&amp;title=Men%C3%BA+en+Acorde%C3%B3n+en+Ajax" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://2kblog.net/menu-en-acordeon-en-ajax/&amp;title=Men%C3%BA+en+Acorde%C3%B3n+en+Ajax" rel="nofollow" class="external" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://2kblog.net/menu-en-acordeon-en-ajax/&amp;title=Men%C3%BA+en+Acorde%C3%B3n+en+Ajax" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://2kblog.net/menu-en-acordeon-en-ajax/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://2kblog.net/menu-en-acordeon-en-ajax/&amp;t=Men%C3%BA+en+Acorde%C3%B3n+en+Ajax" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://2kblog.net/menu-en-acordeon-en-ajax/&amp;t=Men%C3%BA+en+Acorde%C3%B3n+en+Ajax" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://twitter.com/home?status=Men%C3%BA+en+Acorde%C3%B3n+en+Ajax+-+http://2kblog.net/149+(via+@DoctorAnonimous)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li class="sexy-mail"><a href="mailto:?subject=%22Men%C3%BA%20en%20Acorde%C3%B3n%20en%20Ajax%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Hoy%20veremos%20como%20crear%20un%20menu%20en%20forma%20de%20acorde%C3%B3n%20de%20forma%20sencilla%20tan%20solo%20con%20unos%20pocos%20pasos.%20Estos%20menus%20suelen%20estar%20en%20alg%C3%BAn%20lateral%20de%20una%20web%20ya%20que%20se%20expenden%20o%20contraen%20de%20forma%20vertical.%20%C3%89ste%20ejemplo%20es%20muy%20sencillo%20aunque%20por%20supuesto%20tambi%C3%A9n%20a%C3%B1adir%C3%A9%20la%20descarga%20del%20archivo%20de%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://2kblog.net/menu-en-acordeon-en-ajax/" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://2kblog.net/menu-en-acordeon-en-ajax/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://2kblog.net/menu-en-acordeon-en-ajax/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Scroll suavizado &#8211; Smooth scroll</title>
		<link>http://2kblog.net/scroll-suavizado-smooth-scroll/</link>
		<comments>http://2kblog.net/scroll-suavizado-smooth-scroll/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 14:08:46 +0000</pubDate>
		<dc:creator>Krato</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[2kblog]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jQuery scroll]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[scroll jQuery]]></category>
		<category><![CDATA[scroll simple]]></category>
		<category><![CDATA[scroll suavizado]]></category>
		<category><![CDATA[scroll vertcal]]></category>
		<category><![CDATA[scroll vertical]]></category>
		<category><![CDATA[simple scroll]]></category>
		<category><![CDATA[simple sooth scroll]]></category>
		<category><![CDATA[smooth scroll]]></category>
		<category><![CDATA[smooth scroll vertical]]></category>

		<guid isPermaLink="false">http://2kblog.net/?p=128</guid>
		<description><![CDATA[En este entrada vamos a poder ver como crear un scroll suavizado con jQuery. Además es muy sencillo y personalizable. Un scroll suavizado o smooth scroll es una manera de desplazarnos entre los link que apuntan a la misma página (mediante los ids). En una página web normal, si pulsamos sobre un enlace que llama [...]]]></description>
			<content:encoded><![CDATA[<p>En este entrada vamos a poder ver como crear un scroll suavizado con jQuery. Además es muy sencillo y personalizable. Un scroll suavizado o smooth scroll es una manera de desplazarnos entre los link que apuntan a la misma página (mediante los ids). En una página web normal, si pulsamos sobre un enlace que llama a otra parte de esa web esta carga sin hacerlo de una manera bonita. Mediante este plugin la página se desplazará automaticamente hacia esa id.</p>
<p>Comencemos con el código:</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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot; type=&quot;text/javascript&quot;&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;</span>
jQuery<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>
  jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a[href*=#]'</span><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: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span> <span style="color: #339933;">=</span> jQuery<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;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> no <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#otro'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'#otro'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span>  total <span style="color: #339933;">=</span> no.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> velocidad <span style="color: #339933;">=</span> <span style="color: #CC0000;">2000</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;=</span>total<span style="color: #339933;">;</span>i<span style="color: #339933;">++</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>no<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	   <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span> 
&nbsp;
 <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>location.<span style="color: #660066;">pathname</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\//</span><span style="color: #339933;">,</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pathname</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\//</span><span style="color: #339933;">,</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span>
 <span style="color: #339933;">&amp;&amp;</span> location.<span style="color: #660066;">hostname</span> <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hostname</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> target <span style="color: #339933;">=</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hash</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   target <span style="color: #339933;">=</span> target.<span style="color: #660066;">length</span> <span style="color: #339933;">&amp;&amp;</span> target
&nbsp;
   <span style="color: #339933;">||</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[name='</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hash</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span><span style="color: #3366CC;">']'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>target.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> targetOffset <span style="color: #339933;">=</span> target.<span style="color: #660066;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">top</span><span style="color: #339933;">;</span>
  jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html,body'</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>scrollTop<span style="color: #339933;">:</span> targetOffset<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> velocidad<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</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: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>A primera parece un poco largo pero es que he añadido algunas mejoras. Entre ellas las siguientes:</p>
<ol>
<li>Como veis en la primera linea hay que llamar también a jQuery. Lo volvemos a cargar desde google y ya está  <img class="lmbbox_smileys_img" src="http://2kblog.net/wp-content/plugins/lmbbox-smileys/smileys/tb/rolleyes.gif" alt=":rolleyes_tb:" /> </li>
<li>Podemos configurar la velocidad: En la liena 8 está la variable velocidad y tan solo tendremos que cambiar la duración. Recordad que son milisegundos por lo que 2000 son 2 segundos.</li>
<li>Podemos filtrar las anclas (links que hacen referencia a la misma página) que queramos para que no funcione el efecto sobre ellas. Útil por ejemplo si utiliamos tabs en la misma página o tros plugins que utilizan ids. Para ello tan solo debeis añadir las anclas que no querais en el vector (array) <em>no </em><span style="font-weight: normal;">(linea 6).  Podeis añadir los id que querais por ejemplo :</span>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> no <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#uno'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'#dos'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'#tres'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'#cuatro'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'#cinco'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Recodar añadir la almoadilla <em><strong>#</strong></em> antes del nombre.</li>
</ol>
<p><strong><span style="font-weight: normal;">Y ya está tendreis vuestro scroll suavizado!</span></strong></p>
<p><strong><span style="font-weight: normal;">Como no, podeis descargaros un ejmplo para ver como funciona. ÉSta vez he creado el estilo en la mísma página.</span></strong></p>
<p style="text-align: center; "><strong><span style="font-weight: normal;"><a href="http://2kblog.net/wp-content/plugins/download-monitor/download.php?id=5" title="Descargado 49 veces"><img src="http://2kblog.net/DOWN.png" alt="Scroll suavizado - Smooth Scroll" /></a></span></strong></p>
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-wealth"><ul class="socials"><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://2kblog.net/scroll-suavizado-smooth-scroll/&amp;title=Scroll+suavizado+-+Smooth+scroll" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://2kblog.net/scroll-suavizado-smooth-scroll/&amp;title=Scroll+suavizado+-+Smooth+scroll" rel="nofollow" class="external" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://2kblog.net/scroll-suavizado-smooth-scroll/&amp;title=Scroll+suavizado+-+Smooth+scroll" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://2kblog.net/scroll-suavizado-smooth-scroll/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://2kblog.net/scroll-suavizado-smooth-scroll/&amp;t=Scroll+suavizado+-+Smooth+scroll" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://2kblog.net/scroll-suavizado-smooth-scroll/&amp;t=Scroll+suavizado+-+Smooth+scroll" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://twitter.com/home?status=Scroll+suavizado+-+Smooth+scroll+-+http://2kblog.net/128+(via+@DoctorAnonimous)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li class="sexy-mail"><a href="mailto:?subject=%22Scroll%20suavizado%20-%20Smooth%20scroll%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22En%20este%20entrada%20vamos%20a%20poder%20ver%20como%20crear%20un%20scroll%20suavizado%20con%20jQuery.%20Adem%C3%A1s%20es%20muy%20sencillo%20y%20personalizable.%20Un%20scroll%20suavizado%20o%20smooth%20scroll%20es%20una%20manera%20de%20desplazarnos%20entre%20los%20link%20que%20apuntan%20a%20la%20misma%20p%C3%A1gina%20%28mediante%20los%20ids%29.%20En%20una%20p%C3%A1gina%20web%20normal%2C%20si%20pulsamos%20sobre%20un%20e%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://2kblog.net/scroll-suavizado-smooth-scroll/" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://2kblog.net/scroll-suavizado-smooth-scroll/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://2kblog.net/scroll-suavizado-smooth-scroll/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fullsize.js  ¿Qué es?</title>
		<link>http://2kblog.net/fullsize-js-%c2%bfque-es/</link>
		<comments>http://2kblog.net/fullsize-js-%c2%bfque-es/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 20:13:40 +0000</pubDate>
		<dc:creator>Krato</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax lightbox]]></category>
		<category><![CDATA[ajx]]></category>
		<category><![CDATA[etiqueta fullsize]]></category>
		<category><![CDATA[fullsize]]></category>
		<category><![CDATA[fullsize tag]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[nuevo lightbox]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://2kblog.net/?p=97</guid>
		<description><![CDATA[Fullsize es proyecto web basado en jQuery que intenta conseguir un nuevo atriobuto en la etiqueta &#60;img&#62; llamado fullsize en la próxima version del HTML. Pero, ¿que añade esa nueva etiqueta? Pues una nueva manera de crear un lightbox de la manera más sencilla.
Tan solo llamandolo mediante el siguiente ejemplo tendríamos el lightbox:

&#60;img src=&#34;mimagen-normal.jpg&#34; alt=&#34;Imagen&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Fullsize es proyecto web basado en jQuery que intenta conseguir un nuevo atriobuto en la etiqueta &lt;img&gt; llamado <em>fullsize </em>en la próxima version del HTML. Pero, ¿que añade esa nueva etiqueta? Pues una nueva manera de crear un lightbox de la manera más sencilla.</p>
<p>Tan solo llamandolo mediante el siguiente ejemplo tendríamos el lightbox:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mimagen-normal.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Imagen&quot;</span> fullsize<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imagen-grande.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p>Mientras esperamos que la W3C  acepte el reto de incluirlo en su nueva versión podemos usar el plugin de jquey mediante el atributo <em>longdesc </em>que por ahora sí es válido, de la siguiente manera:</p>
<ol>
<li>Link de referencia al css y al js</li>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tu_ruta/fullsize/fullsize.css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tu_ruta/fullsize/jquery.fullsize.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<li> Lo declaramos:

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
&nbsp;
$(&quot;img&quot;).fullsize();
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

</li>
<li> Y la llamada al script en la imagen:</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mimagen-normal.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Imagen&quot;</span> <span style="color: #000066;">longdesc</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imagen-grande.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p>Además el js tan solo ocupa 12kb!</p>
<p>No dudes en pasarte por su página y dar tu apoyo a ésta iniciativa. Yo ya lo hecho! <a href="http://www.addfullsize.com/" target="_blank">Visitar Fullsize</a></p>
<p>También puedes descargar el archivo desde aquí:</p>
<p style="text-align: center;"><a href="http://2kblog.net/wp-content/plugins/download-monitor/download.php?id=3" title="Descargado 221 veces"><img src="http://2kblog.net/DOWN.png" alt="Fullsize" /></a></p>
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-wealth"><ul class="socials"><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://2kblog.net/fullsize-js-%c2%bfque-es/&amp;title=Fullsize.js++%C2%BFQu%C3%A9+es%3F" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://2kblog.net/fullsize-js-%c2%bfque-es/&amp;title=Fullsize.js++%C2%BFQu%C3%A9+es%3F" rel="nofollow" class="external" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://2kblog.net/fullsize-js-%c2%bfque-es/&amp;title=Fullsize.js++%C2%BFQu%C3%A9+es%3F" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://2kblog.net/fullsize-js-%c2%bfque-es/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://2kblog.net/fullsize-js-%c2%bfque-es/&amp;t=Fullsize.js++%C2%BFQu%C3%A9+es%3F" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://2kblog.net/fullsize-js-%c2%bfque-es/&amp;t=Fullsize.js++%C2%BFQu%C3%A9+es%3F" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://twitter.com/home?status=Fullsize.js++%C2%BFQu%C3%A9+es%3F+-+http://2kblog.net/97+(via+@DoctorAnonimous)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li class="sexy-mail"><a href="mailto:?subject=%22Fullsize.js%20%20%C2%BFQu%C3%A9%20es%3F%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Fullsize%20es%20proyecto%20web%20basado%20en%20jQuery%20que%20intenta%20conseguir%20un%20nuevo%20atriobuto%20en%20la%20etiqueta%20%26lt%3Bimg%26gt%3B%20llamado%20fullsize%20en%20la%20pr%C3%B3xima%20version%20del%20HTML.%20Pero%2C%20%C2%BFque%20a%C3%B1ade%20esa%20nueva%20etiqueta%3F%20Pues%20una%20nueva%20manera%20de%20crear%20un%20lightbox%20de%20la%20manera%20m%C3%A1s%20sencilla.%0D%0A%0D%0ATan%20solo%20llamandolo%20mediant%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://2kblog.net/fullsize-js-%c2%bfque-es/" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://2kblog.net/fullsize-js-¿que-es/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://2kblog.net/fullsize-js-%c2%bfque-es/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
