<?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>José Suárez Córdova</title>
	<atom:link href="http://josesuarezcordova.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://josesuarezcordova.com</link>
	<description>Tapas, cañas y código mucho código</description>
	<lastBuildDate>Wed, 25 Nov 2009 09:35:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Galeria de Fotos PHP sin BBDD</title>
		<link>http://josesuarezcordova.com/?p=307</link>
		<comments>http://josesuarezcordova.com/?p=307#comments</comments>
		<pubDate>Wed, 25 Nov 2009 09:35:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Varios]]></category>
		<category><![CDATA[$closedir]]></category>
		<category><![CDATA[$ksort]]></category>
		<category><![CDATA[$opendir]]></category>
		<category><![CDATA[abrir directorio]]></category>
		<category><![CDATA[catalogo]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=307</guid>
		<description><![CDATA[
publicidad


Muy buenas tigres de la programacion, bueno aqui nuevamente para mostrarles un recurso que les puede interesar, resulta que hace poco teniamos que resolver un problemilla, que era mostrar distintas imagenes a especie de catalogo de productos, hasta ahi todo sencillo porque con un &#8220;img src&#8221; se hubiera terminado el tema, pero el cliente queria [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Muy buenas tigres de la programacion, bueno aqui nuevamente para mostrarles un recurso que les puede interesar, resulta que hace poco teniamos que resolver un problemilla, que era mostrar distintas imagenes a especie de catalogo de productos, hasta ahi todo sencillo porque con un &#8220;img src&#8221; se hubiera terminado el tema, pero el cliente queria cambiarlas el y no tenia ni p&#8230;. idea de HTML ni de PHP queria el agregar o quitar fotos cuando quisiera, bueno eso tampoco significaria mucho pues podiamos desarrollar un pequeño gestor de contenidos especificamente para esta seccion, osea subir, cambiar y eliminar fotitos.. nada del otro mundo, pero, aqui viene el tema y lo cabrones que quieren ser los clientes cuando quieren <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  que no queria aumentar su presupuesto!!!! osea queria las joyas del nilo a precio de &#8220;todo 100&#8243;, bueno como era un cliente recomendado y teniamos que hacerlo para no quedar mal, negociamos un poco y despues de algunos arañazos y mordidas, resolvimos el tema para &#8220;bien&#8221; de los dos, lo pongo entre comillas porque fue un chollo para el cliente. Pero al menos nos sirvio de ejercicio para poner algo en este venerable blog de vuestro servidor <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />

<p>
Bueno, ahora explico como solucionamos este asunto.
<p>
<b>1.-Organizamos la estructura de carpetas donde estaran las imagenes que se van a mostrar. </b><br />
<b>2.- Creamos un fichero que abrira y recorrera la carpeta asi como  mostrara las imagenes. A este fichero le llamaremos catalogo_view.php y tendra el siguiente codigo.</b></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p307code9'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p3079"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code" id="p307code9"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$dir</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;imagenes/galeria/&quot;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #000088;">$directorio</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/opendir" onclick="pageTracker._trackPageview('/outgoing/www.php.net/opendir?referer=');"><span style="color: #990000;">opendir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #000088;">$ancho</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$alto</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivo</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/readdir" onclick="pageTracker._trackPageview('/outgoing/www.php.net/readdir?referer=');"><span style="color: #990000;">readdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$directorio</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivo</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;.&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$archivo</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;..&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$ext</span><span style="color: #339933;">=</span><a href="http://www.php.net/explode" onclick="pageTracker._trackPageview('/outgoing/www.php.net/explode?referer=');"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$archivo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/strtolower" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtolower?referer=');"><span style="color: #990000;">strtolower</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'jpg'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'png'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'gif'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'jpeg'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>		
			<span style="color: #000088;">$archivos</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$archivo</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #000088;">$archivo</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;&lt;img  src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #000088;">$archivo</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$ancho</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'height=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$alto</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;&lt;/a&gt;'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>	
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<a href="http://www.php.net/closedir" onclick="pageTracker._trackPageview('/outgoing/www.php.net/closedir?referer=');"><span style="color: #990000;">closedir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$directorio</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/ksort" onclick="pageTracker._trackPageview('/outgoing/www.php.net/ksort?referer=');"><span style="color: #990000;">ksort</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Ahora procedo a explicar brevemente las partes mas importantes.
<p>
En la primera linea definimos una variable $dir con la ruta exacta donde estan las imagenes a utilizar. La siguiente linea abre el directorio y guarda la informacion en la variable $directorio.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p307code10'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p30710"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p307code10"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$dir</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;imagenes/galeria/&quot;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$directorio</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/opendir" onclick="pageTracker._trackPageview('/outgoing/www.php.net/opendir?referer=');"><span style="color: #990000;">opendir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Ahora definimos las variables que guardan las dimensiones de las imagenes en formato thumbnail. Tener cuidado con guardar la proporcion de imagen.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p307code11'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p30711"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p307code11"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$ancho</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$alto</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Lo siguiente es recorrer la carpeta donde tenemos las imagenes y evita que se recorran indices que podrian vulnerar la seguridad, recuerden, a este nivel trabajamos a modo UNIX.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p307code12'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p30712"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p307code12"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivo</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/readdir" onclick="pageTracker._trackPageview('/outgoing/www.php.net/readdir?referer=');"><span style="color: #990000;">readdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$directorio</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivo</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;.&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$archivo</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;..&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

<p>Ahora buscamos el &#8220;.&#8221; para empezar a filtrar los ficheros por su extension, recuerden queremos obtener las imagenes con formato &#8216;jpg&#8217;, &#8216;png&#8217;, &#8216;gif&#8217; o &#8216;jpeg&#8217;. Pero no se limiten que ahi pueden poner la extension que quieran.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p307code13'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p30713"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p307code13"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$ext</span><span style="color: #339933;">=</span><a href="http://www.php.net/explode" onclick="pageTracker._trackPageview('/outgoing/www.php.net/explode?referer=');"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$archivo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/strtolower" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtolower?referer=');"><span style="color: #990000;">strtolower</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'jpg'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'png'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'gif'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ext</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'jpeg'</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>A continuacion guardamos cada imagen de la carpeta en una posicion determinada del array $archivo[], le he puesto un enlace porque en realidad tenia un efecto lightbox para darle un toque mas guapo.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p307code14'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p30714"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p307code14"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$archivos</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$archivo</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #000088;">$archivo</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; rel=&quot;lightbox[roadtrip]&quot;&gt;&lt;img  src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #000088;">$archivo</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$ancho</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'height=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$alto</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;&lt;/a&gt;'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Por ultimo cerramos el directorio, no olvidar, y ordenamos la matriz por clave.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p307code15'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p30715"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p307code15"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/closedir" onclick="pageTracker._trackPageview('/outgoing/www.php.net/closedir?referer=');"><span style="color: #990000;">closedir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$directorio</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/ksort" onclick="pageTracker._trackPageview('/outgoing/www.php.net/ksort?referer=');"><span style="color: #990000;">ksort</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>
<p>
Pero ahi no queda la cosa jejeje nonono .. ahora tenemos que crear otro fichero que cargara nuestra genial programacion, y recorrera el array $archivo para mostrarlo en la pagina.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p307code16'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p30716"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p307code16"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalogo_view.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivos</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$enlaces_uo</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<a href="http://www.php.net/echo" onclick="pageTracker._trackPageview('/outgoing/www.php.net/echo?referer=');"><span style="color: #990000;">echo</span></a> <span style="color: #000088;">$enlaces_uo</span><span style="color: #339933;">;</span>						
			<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>
<p>
Y listo, asi de facil, ahora a probarlo y si teneis alguna duda, ya sabes donde encontrarme en el bar de Pepe el Toro <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Saludos!</p>
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=307</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Colores Hexadecimales</title>
		<link>http://josesuarezcordova.com/?p=296</link>
		<comments>http://josesuarezcordova.com/?p=296#comments</comments>
		<pubDate>Sat, 10 Oct 2009 14:34:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Varios]]></category>
		<category><![CDATA[colores]]></category>
		<category><![CDATA[colores hexadecimales]]></category>
		<category><![CDATA[hexadecimal]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[paleta colores]]></category>
		<category><![CDATA[paleta de colores]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=296</guid>
		<description><![CDATA[
publicidad


Hola chavalotes   que pensabais que ya me habia vuelto a Perú! nooooo, aqui denuevo reloaded!, bueno a lo nuestro , aqui les dejo una cosilla que seguro os va a servir un guebo, con esta paleta tendreis los colores hexa chupaos!

Que lo disfruten


Agur!
]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Hola chavalotes <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  que pensabais que ya me habia vuelto a Perú! nooooo, aqui denuevo reloaded!, bueno a lo nuestro , aqui les dejo una cosilla que seguro os va a servir un guebo, con esta paleta tendreis los colores hexa chupaos!</p>
<p><br/><br />
Que lo disfruten<br />
<iframe src="http://josesuarezcordova.com/paletacolores.php" style="width:90%; height:450px;"></iframe></p>
<p><br/><br />
Agur!</p>
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=296</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enviando mensajes HTML con PHP-Mail (III)</title>
		<link>http://josesuarezcordova.com/?p=277</link>
		<comments>http://josesuarezcordova.com/?p=277#comments</comments>
		<pubDate>Thu, 24 Sep 2009 13:36:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Varios]]></category>
		<category><![CDATA[formulario de contacto]]></category>
		<category><![CDATA[formularios php]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mensajes HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php mail]]></category>
		<category><![CDATA[phpmail]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=277</guid>
		<description><![CDATA[
publicidad


Buenas amigos del PHP y demas hierbas, despues de un breve tiempo &#8220;fuera del ring&#8221; he vuelto para poner algunas cosillas. Continuando con el tema del envio de mensajes por PHP, como ya les repito es muy util que le hagais a vuestros clientes cuando tengais alguna chapuzilla web, pues un formulario de envio de [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Buenas amigos del PHP y demas hierbas, despues de un breve tiempo &#8220;fuera del ring&#8221; he vuelto para poner algunas cosillas. Continuando con el tema del envio de mensajes por PHP, como ya les repito es muy util que le hagais a vuestros clientes cuando tengais alguna chapuzilla web, pues un formulario de envio de contactos o presupuestos, etc.. en condiciones, entonces a todo lo que estabamos haciendo le faltaba el envio de mensajes como HTML, osea que nos llegue el mensaje ordenado con formato HTML predefinido y bien, esto a los clientes les vuelve loco: <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  asi que aprovechen el siguiente codigo que es muy sencillo ademas es el codigo de un caso real.</p>
<p>Bueno, primero como siempre creamos un formulario, en este caso me la he currado y he hecho un formulario como debe ser con capas y todo correctamente ordenado o al menos eso parece <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p277code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p27719"><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
</pre></td><td class="code" id="p277code19"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;contenidosformulario&quot;</span> style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:30%; border:1px solid;&quot;</span><span style="color: #339933;">&gt;</span> 
<span style="color: #339933;">&lt;</span>form name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;form1&quot;</span> action<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;enviar3.php&quot;</span> method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span>
	 <span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:100%; float:left;&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;float:left;&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>label<span style="color: #339933;">&gt;</span>empresa<span style="color: #339933;">:&lt;/</span>label<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;empresa&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;empresa&quot;</span><span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
             <span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:100%; float:left;&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;float:left;&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>label<span style="color: #339933;">&gt;</span>persona de contacto<span style="color: #339933;">:&lt;/</span>label<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;contacto&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;contacto&quot;</span><span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
             <span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:100%; float:left;&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;float:left;&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>label<span style="color: #339933;">&gt;</span>teléf<span style="color: #339933;">.</span> de contacto<span style="color: #339933;">:&lt;/</span>label<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;telefono&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;telefono&quot;</span><span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:100%; float:left;&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;float:left;&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>label<span style="color: #339933;">&gt;</span>e<span style="color: #339933;">-</span><a href="http://www.php.net/mail" onclick="pageTracker._trackPageview('/outgoing/www.php.net/mail?referer=');"><span style="color: #990000;">mail</span></a><span style="color: #339933;">:&lt;/</span>label<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;email&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;email&quot;</span><span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
             <span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:100%; float:left;&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;float:left;&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>label<span style="color: #339933;">&gt;</span>Comentarios<span style="color: #339933;">:&lt;/</span>label<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:100%; float:left;&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;float:left;&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>textarea id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comentario&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comentario&quot;</span> cols<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;40&quot;</span> rows<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #339933;">&gt;&lt;/</span>textarea<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:100%; float:left;&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;float:right;&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>label <span style="color: #b1b100;">for</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">&gt;&amp;</span>nbsp<span style="color: #339933;">;&lt;/</span>label<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;</span>input <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;btn&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Enviar consulta&quot;</span><span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Facil no? pero si esto es XHTML de primero de ESO !! <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  jejejeje bueno ahora creamos el proceso, recordar publicar el proceso en un servidor con server APACHE o alguno que permita ejecutar PHP o en su XAMPP de toda la vida <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p277code20'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p27720"><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
</pre></td><td class="code" id="p277code20"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$empresa</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'empresa'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$contacto</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contacto'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$telefono</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'telefono'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$comentario</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comentario'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$headers</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'MIME-Version: 1.0'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Content-type: text/html; charset=iso-8859-1'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'From: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$email</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$mensaje</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;b&gt;Empresa:&lt;/b&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$empresa</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br/&gt;&quot;</span><span style="color: #339933;">.</span>
<span style="color: #0000ff;">&quot;&lt;b&gt;Nombre:&lt;/b&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$contacto</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br/&gt;&quot;</span><span style="color: #339933;">.</span>
<span style="color: #0000ff;">&quot;&lt;b&gt;Telefono:&lt;/b&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$telefono</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br/&gt;&quot;</span><span style="color: #339933;">.</span>
<span style="color: #0000ff;">&quot;&lt;b&gt;Email:&lt;/b&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$email</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br/&gt;&quot;</span><span style="color: #339933;">.</span>
<span style="color: #0000ff;">&quot;&lt;b&gt;Comentario:&lt;/b&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$comentario</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://www.php.net/mail" onclick="pageTracker._trackPageview('/outgoing/www.php.net/mail?referer=');"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'webtrainner@hotmail.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Contacto de la Web'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mensaje</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://www.php.net/header" onclick="pageTracker._trackPageview('/outgoing/www.php.net/header?referer=');"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Location: form3.php?rpta=ok&amp;contacto='</span><span style="color: #339933;">.</span><span style="color: #000088;">$contacto</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Ya sabeis que los datos que estan ahi son temporales, no lo dejeis asi y lo publiqueis hee pajaroo!! que se entera vuestro cliente y os cruje hee!!! <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .  Bueno como veis ya en el mensaje podeis meter HTML sin problemas, lo que querais, esto es un breve ejemplo pero se puede extender a muchas aplicaciones. </p>
<p>
<a href="http://josesuarezcordova.com/mensajesPHP/form3.php">Ver ejemplo</a>
<p>
Pues asi de rapido ha sido este post, espero que os sirva, y ya saben recuerden que esta prueba llega a mi e-mail asi que porfavor no me pidan dinero que estoy a dos velas quilllooo!, Agur!!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=277</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cargando paginas por pais con PHP</title>
		<link>http://josesuarezcordova.com/?p=266</link>
		<comments>http://josesuarezcordova.com/?p=266#comments</comments>
		<pubDate>Mon, 10 Aug 2009 08:32:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ejemplo php]]></category>
		<category><![CDATA[HTTP_ACCEPT_LANGUAGE]]></category>
		<category><![CDATA[lenguaje php]]></category>
		<category><![CDATA[obtener lenguaje php]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=266</guid>
		<description><![CDATA[
publicidad


Buenas, amigos de PHP, otra vez lunes ufff, que mal dia para poner un post, pero bueno aqui estoy &#8220;eme aqui y aqui eme&#8221;, esta vez vamos a detectar el codigo del pais donde os encontreis y segun eso cargareis una u otra pagina, esto viene bien cuando se tienen versiones del Sitio Web para [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Buenas, amigos de PHP, otra vez lunes ufff, que mal dia para poner un post, pero bueno aqui estoy &#8220;eme aqui y aqui eme&#8221;, esta vez vamos a detectar el codigo del pais donde os encontreis y segun eso cargareis una u otra pagina, esto viene bien cuando se tienen versiones del Sitio Web para cada pais aun compartiendo el mismo idioma, bueno lo mas importante es obtener el codigo del  pais donde nos encontramos para esto usamos la funcion $_SERVER["HTTP_ACCEPT_LANGUAGE"]  que nos devolvera el codigo del pais y su correspondiente lenguaje, por ejemplo:</p>
<p>en-us<br />
en-gb<br />
de<br />
nl<br />
en-us,zh;q=0.5<br />
es<br />
en<br />
nl-be<br />

<p>
$_SERVER es una matriz que contiene información tal como headers, paths, y script locations, las entradas a esta matriz son proporcionadas por el servidor web. Esta matriz tiene muchos atributos el que veremos en esta ocasion sera HTTP_ACCEPT_LANGUAGE, pero hay muchas mas como : REQUEST_TIME, QUERY_STRING, HTTP_ACCEPT etc.. para mas informacion podeis ver la madre del los manuales de PHP <a href="http://us2.php.net/manual/en/reserved.variables.server.php" target="_blank" onclick="pageTracker._trackPageview('/outgoing/us2.php.net/manual/en/reserved.variables.server.php?referer=');">el manual oficial</a>.<br />

<p>
Bueno vamos al negocio, crearemos un nuevo documento PHP y ahi escribiremos el siguiente codigo.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p266code23'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p26623"><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
64
65
66
67
68
69
</pre></td><td class="code" id="p266code23"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// IMPORTANTE: </span>
<span style="color: #666666; font-style: italic;">// - Cambia pagina.php por el archivo correcto de acuerdo al pais</span>
<span style="color: #666666; font-style: italic;">// - Quita el comentario del include para que cargue la pagina correspondiente</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset" onclick="pageTracker._trackPageview('/outgoing/www.php.net/isset?referer=');"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pais</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pais</span> <span style="color: #339933;">&lt;&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$cod_pais</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr" onclick="pageTracker._trackPageview('/outgoing/www.php.net/substr?referer=');"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pais</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$cod_pais</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr" onclick="pageTracker._trackPageview('/outgoing/www.php.net/substr?referer=');"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_ACCEPT_LANGUAGE&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<a href="http://www.php.net/echo" onclick="pageTracker._trackPageview('/outgoing/www.php.net/echo?referer=');"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;El codigo de tu pais es: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$cod_pais</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Dependiendo del codigo del pais cargara una u otra pagina;</span>
&nbsp;
<span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dgo_pais</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;es-es&quot;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">//si el pais es España</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;es-pe&quot;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">//si el pais es Perú</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;es-ar&quot;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">//si el pais es Argentina</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;es-cl&quot;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">//si el pais es Chile</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;es-ve&quot;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">//si el pais es Venezuela</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;pt-br&quot;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">//si el pais es brasil</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;es-co&quot;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">//si el pais es colombia</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;es-ec&quot;</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">//si el pais es ecuador</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;es-uy&quot;</span><span style="color: #339933;">:</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//si el pais es uruguay</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span>
	<span style="color: #666666; font-style: italic;">//si es algun otro pais</span>
	<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pagina.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Como veis, primero creamos una condicional que dara siempre FALSE, entonces entrara a esta linea $cod_pais = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,5); donde creamos una variables que guardara el codigo y lenguaje usado por la zona geografica donde nos encontremos, y el resto es historia, usamos un SWITCH/CASE de toda la vida para determinar que pagina cargar dependiendo del valor de la variable,  pero debeis comentar estas lineas<br />
<br />


<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p266code24'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p26624"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p266code24"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/echo" onclick="pageTracker._trackPageview('/outgoing/www.php.net/echo?referer=');"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;El codigo de tu pais es: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$cod_pais</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>
<p>
y claro, cambiar el nombre de la pagina.php dependiendo del caso.<br />

<p>
Bueno pues nada mas, facil no?, si teneis alguna duda ya sabes dejad un comentario  &#8220;pa ver que hacemo quilloo!&#8221; <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />

<p><a href="http://josesuarezcordova.com/pais_php/pais.php">Ver ejemplo</a><br />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=266</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enviando mensajes con PHP-Mail (II)</title>
		<link>http://josesuarezcordova.com/?p=250</link>
		<comments>http://josesuarezcordova.com/?p=250#comments</comments>
		<pubDate>Wed, 05 Aug 2009 14:12:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[enviar mail php]]></category>
		<category><![CDATA[php mail]]></category>
		<category><![CDATA[php mensajes]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=250</guid>
		<description><![CDATA[
publicidad


Buenas denuevo, ahora amigos de PHP, sorprendidos que mande otro post tan rapido, vamos que yo tambien, pero bueno hay que aprovechar el tiempo muerto en el trabajo no?, a ver en este segundo ejemplo tunearemos un poco mas nuestro formulario de envio de mensaje, el anterior lo entendiste no?, sino ya sabes postea un [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Buenas denuevo, ahora amigos de PHP, sorprendidos que mande otro post tan rapido, vamos que yo tambien, pero bueno hay que aprovechar el tiempo muerto en el trabajo no?, a ver en este segundo ejemplo tunearemos un poco mas nuestro formulario de envio de mensaje, el anterior lo entendiste no?, sino ya sabes postea un comentario y vemos que hacemos, 5urs por respuesta jejejejeje mentira, ya sabes que todo esto es Open Source tambien.</p>
<p>
A ver a lo nuestro, veamos el siguiente formulario

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p250code27'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p25027"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p250code27"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>form <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;frmEnviar&quot;</span> action<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;enviar2.php&quot;</span> method<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span>
de<span style="color: #339933;">:&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;remite&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">&gt;&lt;</span>br<span style="color: #339933;">&gt;</span>
tu email<span style="color: #339933;">:&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;emailRemite&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">&gt;&lt;</span>br<span style="color: #339933;">&gt;</span>
email destino<span style="color: #339933;">:&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;destinoEmail&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">&gt;&lt;</span>br<span style="color: #339933;">&gt;</span>
Titulo Mensaje<span style="color: #339933;">:&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;tituloMensaje&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">&gt;&lt;</span>br<span style="color: #339933;">&gt;</span>
Mensaje<span style="color: #339933;">:&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;mensaje&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ok&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>
feo no? pero bueno sirve que es lo que importa, como veis he definido el nombre de los campos a mi parecer, ya vosotros lo hareis segun vuestros requerimientos, ahora veamos el fichero enviar2.php</p>
<p>
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p250code28'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p25028"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p250code28"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
	<span style="color: #000088;">$de</span><span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'remite'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$remiteEmail</span><span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'emailRemite'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$paraEmail</span><span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'destinoEmail'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$tituloMensaje</span><span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'tituloMensaje'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mensaje</span><span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mensaje'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'From:'</span><span style="color: #339933;">.</span><span style="color: #000088;">$de</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'Reply-To:'</span><span style="color: #339933;">.</span><span style="color: #000088;">$remiteEmail</span><span style="color: #339933;">;</span>
&nbsp;
	<a href="http://www.php.net/mail" onclick="pageTracker._trackPageview('/outgoing/www.php.net/mail?referer=');"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$paraEmail</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tituloMensaje</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mensaje</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<a href="http://www.php.net/echo" onclick="pageTracker._trackPageview('/outgoing/www.php.net/echo?referer=');"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;Mensaje enviado con exito!&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Como veis , primero recuperamos todos los datos y luego armamos las variable $mensaje y $headers para realizar el envio, facil a que si, bueno ya sabeis agregad un formulario en condiciones para que vuestros clientes puedan recibir mensajes desde sus Webs, una cosa que me olvide advertirle en el post anterior, esto probadlo en el Hosting, no el localhost.</p>
<p>
Otra cosa, es probable que llegue como correo no deseado, bueno eso es decirle a su cliente de correos que lo registre como un remitente confiable y listo, ahora si podeis probar este ejemplo con vuestro mail. Hasta la proxima pajaros!</p>
<p>
<a href="http://josesuarezcordova.com/mensajesPHP/form2.php">Podeis probar el ejemplo aqui</a>
<p>
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=250</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enviando mensajes con PHP-Mail (I)</title>
		<link>http://josesuarezcordova.com/?p=240</link>
		<comments>http://josesuarezcordova.com/?p=240#comments</comments>
		<pubDate>Wed, 05 Aug 2009 12:12:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[enviar correo electronico]]></category>
		<category><![CDATA[enviar mail con php]]></category>
		<category><![CDATA[enviar mensaje php]]></category>
		<category><![CDATA[mensajeria php]]></category>
		<category><![CDATA[php correo electronico]]></category>
		<category><![CDATA[php mail]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=240</guid>
		<description><![CDATA[
publicidad


Muy buenas amigos del Jquery, bueno ahora veremos algo que siempre interesa en PHP, que es montar un formulario guapo que envie los datos hacia nuestra cuenta de correo, esto es vital en cualquier Web que se digne de serlo, bueno comenzaremos como siempre desde &#8220;0&#8243;, no porque seamos unos melones, sino porque asi podremos [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Muy buenas amigos del Jquery, bueno ahora veremos algo que siempre interesa en PHP, que es montar un formulario guapo que envie los datos hacia nuestra cuenta de correo, esto es vital en cualquier Web que se digne de serlo, bueno comenzaremos como siempre desde &#8220;0&#8243;, no porque seamos unos melones, sino porque asi podremos darnos cuenta como &#8220;tunear&#8221; nuestro formulario y quiza crear cosas mas chulas con esta poderosa herramienta <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , para los que aun no se han enterado de PHP, <a href="http://es.wikipedia.org/wiki/PHP" target="_blank" onclick="pageTracker._trackPageview('/outgoing/es.wikipedia.org/wiki/PHP?referer=');">vean esto para comenzar </a>, y luego vuelva por aqui para continuar <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Bueno para comenzar, creamos un formulario muy simple, un campo donde se escribira el mensaje y el boton submit, todo dentro del form donde se define el fichero PHP que recibira los datos con el atributo &#8220;action&#8221;  y el metodo de envio de datos definido con el atributo &#8220;method&#8221;. Esto quedaria asi:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p240code31'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p24031"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p240code31"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>form <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;frmEnviar&quot;</span> action<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;enviar1.php&quot;</span> method<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span>
Mensaje<span style="color: #339933;">:&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;mensaje&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ok&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Simple verdad? , pues ya esta ya tienes lo mas dificil, jejejjjeje que si que esto es lo mas dificil, lo que viene a continuacion es de risa, claro una vez que le cojas el gustito como todo en la vida no?.  A ver ahi vamos mirad este es el fichero &#8220;enviar1.php&#8221; :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p240code32'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p24032"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p240code32"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
	<span style="color: #000088;">$mensaje</span><span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mensaje'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'From: Jose Suarez'</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'Reply-To: webtrainner@hotmail.com'</span><span style="color: #339933;">;</span>
&nbsp;
	<a href="http://www.php.net/mail" onclick="pageTracker._trackPageview('/outgoing/www.php.net/mail?referer=');"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'webtrainner@hotmail.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Titulo del Mensaje'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mensaje</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<a href="http://www.php.net/echo" onclick="pageTracker._trackPageview('/outgoing/www.php.net/echo?referer=');"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">&quot;Mensaje enviado con exito!&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Primer recuperamos el mensaje que enviamos desde el formulario y lo almacenamos temporalmente en la variable $mensaje, despues definimos la variable $headers donde indicamos quien envia el mensaje, porsupuesto el menda, y a quien deberia de responder, claro el menda tambien <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , esto es importante porque sino saldria algo cutre con un &#8220;No body&#8221; como remitente, eso no mola nada.</p>
<p>
Por ultimo utilizamos el metodo &#8220;mail&#8221; de PHP al que le enviamos los siguientes parametros: [mail_destino], [Titulo_mensaje], [mensaje], [cabecera_mensaje] y para indicar que se ha enviado con exito, el clasico mensaje.</p>
<p>
<a href="http://josesuarezcordova.com/mensajesPHP/form1.php">Podeis probar el ejemplo aqui</a>
<p>
Claro tener cuidado con lo que me envias heee pajaroo!, pues ya sabies si teneis algun problema aqui estoy pa lo que sea, menos dinero <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>
Agur!</p>
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=240</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validate con Jquery</title>
		<link>http://josesuarezcordova.com/?p=227</link>
		<comments>http://josesuarezcordova.com/?p=227#comments</comments>
		<pubDate>Mon, 22 Jun 2009 15:24:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[jose suarez]]></category>
		<category><![CDATA[jquery validate]]></category>
		<category><![CDATA[validacion de formularios con Jquery]]></category>
		<category><![CDATA[validate]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=227</guid>
		<description><![CDATA[
publicidad


Aqui nuevamente amigos del Jquery.. ahora veremos una breve introduccion del plugin Validate de Jquery, como los vereis es muy facil de utilizar, posteriormente ire tuneando este ejemplo, pero espero que este post les sirva, el script necesitara  definir las reglas &#8220;rules&#8221; y los mensajes de error &#8220;messages&#8221;, claro debeis tambien importar las librerias [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Aqui nuevamente amigos del Jquery.. ahora veremos una breve introduccion del plugin Validate de Jquery, como los vereis es muy facil de utilizar, posteriormente ire tuneando este ejemplo, pero espero que este post les sirva, el script necesitara  definir las reglas &#8220;rules&#8221; y los mensajes de error &#8220;messages&#8221;, claro debeis tambien importar las librerias que como siempres las podeis descargar desde aqui.</p>
<p><a href="http://josesuarezcordova.com/ejemplosJquery/validate/js/">Descargarte las libreria</a></p>
<p>No hace falta decir la importancia de validar los campos de formularios, asi que supongo que sabreis como y cuando poder utilizarlo, osea SIEMPREEEEEEEEEEEE PAJARO!!!!</p>
<p>En este ejemplo utilizo un controlador PHP que recibe los datos y ya luego podreis hacer con ellos cualquier cosa. vosotros lo podeis adaptar a vuestros requerimientos.</p>
<h4>prueba1.htm</h4>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p227code35'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p22735"><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" id="p227code35"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>meta http<span style="color: #339933;">-</span>equiv<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;content-type&quot;</span> content<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/html;charset=iso-8859-1&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery-1.2.6.pack.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.validate.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;!--</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
      event<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;blur&quot;</span><span style="color: #339933;">,</span>
      rules<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #3366CC;">'nombre'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;required&quot;</span><span style="color: #339933;">,</span>
        <span style="color: #3366CC;">'email'</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> required<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> email<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #3366CC;">'mensaje'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;required&quot;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
      messages<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #3366CC;">'nombre'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Por favor ingrese su nombre&quot;</span><span style="color: #339933;">,</span>
        <span style="color: #3366CC;">'email'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Ingrese una dirección de e-mail válida&quot;</span><span style="color: #339933;">,</span>
        <span style="color: #3366CC;">'mensaje'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Por favor, ingrese su mensaje o consulta&quot;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
      debug<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
      errorElement<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;label&quot;</span><span style="color: #339933;">,</span>
      submitHandler<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>form<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
          <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Los datos seran enviados'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          form.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#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: #006600; font-style: italic;">//--&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
		label <span style="color: #009900;">&#123;</span> 
      color<span style="color: #339933;">:</span> #000<span style="color: #339933;">;</span> 
      font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span> 1em<span style="color: #339933;">;</span> 
      line<span style="color: #339933;">-</span>height<span style="color: #339933;">:</span> <span style="color: #CC0000;">140</span><span style="color: #339933;">%;</span> 
      margin<span style="color: #339933;">:</span> 10px <span style="color: #CC0000;">0</span> .2em 90px<span style="color: #339933;">;</span> 
      display<span style="color: #339933;">:</span> block<span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span>
&nbsp;
    .<span style="color: #660066;">error</span><span style="color: #339933;">-</span>message<span style="color: #339933;">,</span> label.<span style="color: #660066;">error</span> <span style="color: #009900;">&#123;</span> 
      color<span style="color: #339933;">:</span> #bb0000<span style="color: #339933;">;</span> 
      margin<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>  
      display<span style="color: #339933;">:</span> block<span style="color: #339933;">;</span> 
      font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span> 0.5em<span style="color: #339933;">;</span> 
      font<span style="color: #339933;">-</span>weight<span style="color: #339933;">:</span>bold<span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>form id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;form&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;form&quot;</span> method<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;post&quot;</span>  action<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;proceso.php&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>table width<span style="color: #339933;">=</span><span style="color: #CC0000;">500</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span> 
        <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>label <span style="color: #000066; font-weight: bold;">for</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ContactName&quot;</span><span style="color: #339933;">&gt;</span>nombre<span style="color: #339933;">:&lt;/</span>label<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>input <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;nombre&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;textField&quot;</span> maxlength<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;255&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ContactName&quot;</span> <span style="color: #339933;">/&gt;</span>
    <span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>label <span style="color: #000066; font-weight: bold;">for</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ContactRecipient&quot;</span><span style="color: #339933;">&gt;</span>email<span style="color: #339933;">:&lt;/</span>label<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>input <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;email&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;textField &quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ContactRecipient&quot;</span> <span style="color: #339933;">/&gt;</span>
    <span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>label <span style="color: #000066; font-weight: bold;">for</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ContactPhone&quot;</span><span style="color: #339933;">&gt;</span>fono<span style="color: #339933;">:&lt;/</span>label<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>input <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;telefono&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;textField&quot;</span> maxlength<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;255&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ContactPhone&quot;</span> <span style="color: #339933;">/&gt;</span>
    <span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
       <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>label <span style="color: #000066; font-weight: bold;">for</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ContactMessage&quot;</span><span style="color: #339933;">&gt;</span>mensaje<span style="color: #339933;">:&lt;/</span>label<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>textarea <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;mensaje&quot;</span> cols<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;20&quot;</span> rows<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;3&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;textArea&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ContactMessage&quot;</span> <span style="color: #339933;">&gt;&lt;/</span>textarea<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;&amp;</span>nbsp<span style="color: #339933;">;&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>center<span style="color: #339933;">&gt;&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;enviar datos&quot;</span><span style="color: #339933;">&gt;&lt;/</span>center<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Como veis el codigo presenta ciertas caracteristicas que empezare a describir, al menos las mas importantes:</p>
<p><b> $(&#8220;#form&#8221;).validate({</b> .- Aqui debeis indicar la id del formulario a validar.<br />
<b>event: &#8220;blur&#8221;</b>.- Aqui se establece el evento con el que se disparara la validacion, esto es util porque cuando te aparezcan los mensajes de validacion y empeceis a completar los campos y hagas el blur() se iran validando.<br />
<b>rules: </b>.- Aqui se definen las reglas para los campos, recordar ponerle id&#8217;s a los campos a validar.<br />
<b>messages:</b>.- Aqui los mensajes que apareceran cuando dejeis un campo sin validar.<br />
<b> submitHandler</b>.- Aqui podeis definir las acciones a realizar cuando la validacion sera correcta.</p>
<p>Pues como veis es bastante sencillo, solo claro procura repetir el ejemplo e ir cambiando cosillas para que veas resultados. Bueno ahora os paso el PHP que recibiria los datos, no es gran cosa, pero os servira para completar la idea.</p>
<h4>proceso.php</h4>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p227code36'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p22736"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p227code36"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;?</span>php
echo <span style="color: #3366CC;">&quot;Llegaron los datos --&gt; Nombre:&quot;</span>.$_REQUEST<span style="color: #009900;">&#91;</span>nombre<span style="color: #009900;">&#93;</span>.<span style="color: #3366CC;">&quot;/e-mail:&quot;</span>.$_REQUEST<span style="color: #009900;">&#91;</span>email<span style="color: #009900;">&#93;</span>.<span style="color: #3366CC;">&quot;/Telefono:&quot;</span>.$_REQUEST<span style="color: #009900;">&#91;</span>telefono<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">?&gt;</span></pre></td></tr></table></div>

<p>Listo.. ¡ezto e to chiquillo! <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Pruebalo y que os aproveche. <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/validate/prueba1.htm" target="_blank">ver ejemplo</a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=227</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DatePicker, Calendario con Jquery UI</title>
		<link>http://josesuarezcordova.com/?p=220</link>
		<comments>http://josesuarezcordova.com/?p=220#comments</comments>
		<pubDate>Wed, 17 Jun 2009 07:14:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[calendario jquery]]></category>
		<category><![CDATA[datepicker]]></category>
		<category><![CDATA[jose suarez jquery]]></category>
		<category><![CDATA[jquery facil]]></category>
		<category><![CDATA[Jquery UI]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=220</guid>
		<description><![CDATA[
publicidad


Hola Amigos del Jquery.
Jquery UI es una libreria que contiene permite utilizar un diversos plugins y widgets que potencializan el uso de Jquery en nuestras aplicaciones web, no contare toda la historia de JQuery UI, pero si adelantare que actualmente se usa mas IU que Interface, pues tiene librerias actualizadas y efectos mas espectaculares pero [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Hola Amigos del Jquery.</p>
<p>Jquery UI es una libreria que contiene permite utilizar un diversos plugins y widgets que potencializan el uso de Jquery en nuestras aplicaciones web, no contare toda la historia de JQuery UI, pero si adelantare que actualmente se usa mas IU que Interface, pues tiene librerias actualizadas y efectos mas espectaculares pero no por eso es mejor que Interface, sino digamos que &#8220;mas guay&#8221; <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Bueno veremos hoy como implementar rapidamente un calendario con esta libreria, como siempre os dare la ruta para que podais descargar los recursos..</p>
<p><a href="http://josesuarezcordova.com/ejemplosJquery/jqueryui/jquery-ui-1.7.2.custom.zip">Descargarte las libreria</a></p>
<h3>DatePicker</h3>
<p>Es de mucha utilidad un calendario para que se puedan insertar fechas en formularios, y hay cien millones de formas de hacerlo con mas o menos codigo, pero veamos como implementarlo sin muchas historias, luego veremos como ir personalizando algunas opciones.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p220code38'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p22038"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p220code38"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>link type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;css/ui-lightness/jquery-ui-1.7.2.custom.css&quot;</span> rel<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;stylesheet&quot;</span> <span style="color: #339933;">/&gt;</span>	
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery-1.3.2.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery-ui-1.7.2.custom.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#datepicker&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">datepicker</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> dateFormat<span style="color: #339933;">:</span> <span style="color: #3366CC;">'dd-mm-yy'</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>
&nbsp;
<span style="color: #339933;">&lt;</span>div <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;demo&quot;</span><span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Date<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>input id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;datepicker&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span><span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Aqui tenemos una caja de texto y a esta se le da una &#8220;id=datepicker&#8221;, la cual desde el script se le aplica el efecto &#8220;datepicker&#8221; al pinchar sobre ella, si te encuentras en un pais hispanohablante creo que te servira el formato &#8216;dd-mm-yy&#8217;  pero si estas en un pais angloparlante, te servira el formato que sale por defecto &#8216;mm-dd-yy&#8217;  ¡y si no estas en este planeta, pajaro! pues preguntale a algun marciano que formato usan haa! <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  pajaro!.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/jqueryui/calendario.html" target="_blank">ver ejemplo</a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=220</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Efecto FishEye con Interface y Jquery</title>
		<link>http://josesuarezcordova.com/?p=212</link>
		<comments>http://josesuarezcordova.com/?p=212#comments</comments>
		<pubDate>Fri, 12 Jun 2009 07:17:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[efecto ojo de pez]]></category>
		<category><![CDATA[eyefish]]></category>
		<category><![CDATA[eyefish Jquery]]></category>
		<category><![CDATA[jquery interface eyefish]]></category>
		<category><![CDATA[ojo de pez]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=212</guid>
		<description><![CDATA[
publicidad


Buenas denuevo amigos del Jquery, quien no ha visto el clasico efecto de Ojo de Pez en alguna Web y no le ha dado curiosidad por implementarlo en su pagina, pues les adelanto que el tema es muy sencillo y mas claro con Jquery+Interface, veamos como implementarlo, para comenzar debeis tener las librerias jquery.js e [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Buenas denuevo amigos del Jquery, quien no ha visto el clasico efecto de Ojo de Pez en alguna Web y no le ha dado curiosidad por implementarlo en su pagina, pues les adelanto que el tema es muy sencillo y mas claro con Jquery+Interface, veamos como implementarlo, para comenzar debeis tener las librerias jquery.js e interface.js ademas de algunas imagenes que podeis bajar desde el sigiuente enlace</p>
<p><a href="http://josesuarezcordova.com/ejemplosJquery/fisheye/">Descargarte los recursos desde aqui</a></p>
<p>Descargate todo, tanto las imagenes como los scripts.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p212code40'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p21240"><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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
</pre></td><td class="code" id="p212code40"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/interface.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">*</span>
<span style="color: #009900;">&#123;</span>
margin<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
padding<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
.<span style="color: #660066;">fisheye</span><span style="color: #009900;">&#123;</span>
text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span> center<span style="color: #339933;">;</span>
height<span style="color: #339933;">:</span> 50px<span style="color: #339933;">;</span>
position<span style="color: #339933;">:</span> relative<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
a.<span style="color: #660066;">fisheyeItem</span>
<span style="color: #009900;">&#123;</span>
text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span> center<span style="color: #339933;">;</span>
color<span style="color: #339933;">:</span> #000<span style="color: #339933;">;</span>
font<span style="color: #339933;">-</span>weight<span style="color: #339933;">:</span> bold<span style="color: #339933;">;</span>
text<span style="color: #339933;">-</span>decoration<span style="color: #339933;">:</span> none<span style="color: #339933;">;</span>
width<span style="color: #339933;">:</span> 40px<span style="color: #339933;">;</span>
position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
display<span style="color: #339933;">:</span> block<span style="color: #339933;">;</span>
top<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
.<span style="color: #660066;">fisheyeItem</span> img
<span style="color: #009900;">&#123;</span>
border<span style="color: #339933;">:</span> none<span style="color: #339933;">;</span>
margin<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span> auto 5px auto<span style="color: #339933;">;</span>
width<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">%;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
.<span style="color: #660066;">fisheyeItem</span> span
<span style="color: #009900;">&#123;</span>
display<span style="color: #339933;">:</span> none<span style="color: #339933;">;</span>
positon<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>14px<span style="color: #339933;">;</span>
font<span style="color: #339933;">-</span>family<span style="color: #339933;">:</span> verdana<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
.<span style="color: #660066;">fisheyeContainter</span>
<span style="color: #009900;">&#123;</span>
height<span style="color: #339933;">:</span> 50px<span style="color: #339933;">;</span>
width<span style="color: #339933;">:</span> 200px<span style="color: #339933;">;</span>
left<span style="color: #339933;">:</span> 500px<span style="color: #339933;">;</span>
position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<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>
&nbsp;
$<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;">'#fisheye'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Fisheye</span><span style="color: #009900;">&#40;</span>
		<span style="color: #009900;">&#123;</span>
		maxWidth<span style="color: #339933;">:</span> <span style="color: #CC0000;">50</span><span style="color: #339933;">,</span>
		items<span style="color: #339933;">:</span> <span style="color: #3366CC;">'a'</span><span style="color: #339933;">,</span>
		itemsText<span style="color: #339933;">:</span> <span style="color: #3366CC;">'span'</span><span style="color: #339933;">,</span>
		container<span style="color: #339933;">:</span> <span style="color: #3366CC;">'.fisheyeContainter'</span><span style="color: #339933;">,</span>
		itemWidth<span style="color: #339933;">:</span> <span style="color: #CC0000;">40</span><span style="color: #339933;">,</span>
		proximity<span style="color: #339933;">:</span> <span style="color: #CC0000;">90</span><span style="color: #339933;">,</span>
		halign <span style="color: #339933;">:</span> <span style="color: #3366CC;">'center'</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</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>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;fisheye&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;fisheye&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;fisheyeContainter&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;fisheyeItem&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;images/home.png&quot;</span> width<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;30&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>span<span style="color: #339933;">&gt;</span>Home<span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;fisheyeItem&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;images/email.png&quot;</span> width<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;30&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>span<span style="color: #339933;">&gt;</span>Email<span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;fisheyeItem&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;images/display.png&quot;</span> width<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;30&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>span<span style="color: #339933;">&gt;</span>Mostrar<span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;fisheyeItem&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;images/clock.png&quot;</span> width<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;30&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>span<span style="color: #339933;">&gt;</span>Tiempo<span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;fisheyeItem&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;images/web.png&quot;</span> width<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;30&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>span<span style="color: #339933;">&gt;</span>Web<span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Facil , a que si!, pero veamos que podemos destacar de estas lineas.</p>
<p>Primer tomaria en cuenta los estilos, pues como veis , se define un estilo para cada elemento dentro del DIV con id &#8220;fisheye&#8221;, con esto tememos listo la apariencia, ubicacion y colores de fondo, ya les digo que esto es totalmente personalizable.</p>
<p>En segundo lugar o &#8220;segundamente&#8221; jeje, vemos que a la capa &#8220;fisheye&#8221; le asignamos el metodo Fisheye que esta incluido dentro de la libreria interface.js, luego definimos los siguientes parametros:</p>
<p><strong>maxWidth: 50 .-</strong> Maximo tamaño que tomara cada imagen, prevenir deformidades de imagen (pixeleados) teniendo iconos de buen tamaño<br />
<strong>items: &#8216;a&#8217;.-</strong> Se define al hipervinculo como un Item de la lista para el efecto.<br />
<strong>itemsText: &#8217;span&#8217; .- </strong>Se define el span como contenido para el texto de dicho item.<br />
<strong>container: &#8216;.fisheyeContainter&#8217;.-</strong> Define la capa que contiene la lista de Items<br />
<strong>itemWidth: 40.-</strong> se define el tamaño con el que apareceran las imagenes para cada item.<br />
<strong>proximity: 90.-</strong> La velocidad para hacer el zoom<br />
<strong>halign : &#8216;center&#8217;.- </strong>¿que creen que sea?? patatas! nooo pajaro! esto es para la alineacion horizontal <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Pues ya esta.. ahora probadlo y que os aproveche <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/fisheye/ojodepez.htm">ver ejemplo</a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=212</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Efecto Accordion con Jquery</title>
		<link>http://josesuarezcordova.com/?p=203</link>
		<comments>http://josesuarezcordova.com/?p=203#comments</comments>
		<pubDate>Wed, 10 Jun 2009 13:19:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[accordion]]></category>
		<category><![CDATA[acordion]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[jose suarez cordova]]></category>
		<category><![CDATA[jquery acordion]]></category>
		<category><![CDATA[Jquery UI]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=203</guid>
		<description><![CDATA[
publicidad


Buenas, amigos del Jquery, ahora veremos las formas de hacer el conocido efecto Acordion con Jquery, presentare 4 formas de hacerlo y vosotros decidireis cual utilizar, claro,  el que mas se adapte a vuestros proyectos, vereis que alguno es mas facil que otro y mas o menos facil de personalizar, pero si veis el [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Buenas, amigos del Jquery, ahora veremos las formas de hacer el conocido efecto Acordion con Jquery, presentare 4 formas de hacerlo y vosotros decidireis cual utilizar, claro,  el que mas se adapte a vuestros proyectos, vereis que alguno es mas facil que otro y mas o menos facil de personalizar, pero si veis el codigo os dareis cuenta que es muy facil.</p>
<p>Para cada caso usare distintos scripts asi podreis compar cual les viene mejor.</p>
<h2>Acordion con Interface</h2>
<p>Como ya hemos visto en posts anteriores, la interface es una libreria que potencia las funcionalidades de Jquery, ahora veremos como usar esta libreria para crear un interesante efecto, primero os muestro el codigo y luego os explico las lineas mas importantes.</p>
<p><a href="http://josesuarezcordova.com/ejemplosJquery/accordion/">Descargar desde aqui los scripts</a></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p203code44'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p20344"><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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
</pre></td><td class="code" id="p203code44"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/interface.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #009966; font-style: italic;">/*Este estilo limpia el padding y margin de los items de las listas*/</span>
<span style="color: #339933;">*</span><span style="color: #009900;">&#123;</span>
	margin<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
	padding<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009966; font-style: italic;">/* Estilo para el body */</span>
body<span style="color: #009900;">&#123;</span>
	background<span style="color: #339933;">:</span> #fff<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">%;</span>
	font<span style="color: #339933;">-</span>family<span style="color: #339933;">:</span> Arial<span style="color: #339933;">,</span> Helvetica<span style="color: #339933;">,</span> sans<span style="color: #339933;">-</span>serif<span style="color: #339933;">;</span>
	font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span> 12px<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009966; font-style: italic;">/* Estilo para todo la capa que contendra el Acordion */</span>
#my_Accordion<span style="color: #009900;">&#123;</span>
	width<span style="color: #339933;">:</span> 400px<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 1px solid #7c7c7c<span style="color: #339933;">;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	left<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
	top<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009966; font-style: italic;">/* Estilo para la Definition Title */</span>
#my_Accordion dt<span style="color: #009900;">&#123;</span>
	line<span style="color: #339933;">-</span>height<span style="color: #339933;">:</span> 20px<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #7c7c7c<span style="color: #339933;">;</span>
	border<span style="color: #339933;">-</span>top<span style="color: #339933;">:</span> 2px solid #c8c8c8<span style="color: #339933;">;</span>
	border<span style="color: #339933;">-</span>bottom<span style="color: #339933;">:</span> 2px solid #<span style="color: #CC0000;">333</span><span style="color: #339933;">;</span>
	padding<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span> 10px<span style="color: #339933;">;</span>
	font<span style="color: #339933;">-</span>weight<span style="color: #339933;">:</span> bold<span style="color: #339933;">;</span>
	color<span style="color: #339933;">:</span> #fff<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009966; font-style: italic;">/* Estilo para la Definition Details */</span>
#my_Accordion dd<span style="color: #009900;">&#123;</span>
	overflow<span style="color: #339933;">:</span> auto<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009966; font-style: italic;">/* Estilo para los parrafos */</span>
#my_Accordion p<span style="color: #009900;">&#123;</span>
	margin<span style="color: #339933;">:</span> 16px 10px<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009966; font-style: italic;">/* Estilo para el efecto Hover (pasar el puntero) */</span>
#my_Accordion dt.<span style="color: #660066;">my_AccordionHover</span><span style="color: #009900;">&#123;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #<span style="color: #CC0000;">996600</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009966; font-style: italic;">/* Estilo para el efecto Active (activar una definicion mediante clic) */</span>
#my_Accordion dt.<span style="color: #660066;">my_AccordionActive</span><span style="color: #009900;">&#123;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #<span style="color: #CC0000;">996600</span><span style="color: #339933;">;</span>
	border<span style="color: #339933;">-</span>top<span style="color: #339933;">:</span> 2px solid #ffa800<span style="color: #339933;">;</span>
	border<span style="color: #339933;">-</span>bottom<span style="color: #339933;">:</span> 2px solid #000<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #006600; font-style: italic;">/** 
  Script que hace la &quot;magia&quot; se definen los valores de los parametros necesarios para realizar 
  el efecto:
  headerSelector.- para definir que marca sera la cabecera
  panelSelector.- para definir el panel que contiene la informacion
  activeClass / hoverClass.- ya lo suponen no?
  panelHeight / speed.- Mas facil imposible...!
  **/</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#my_Accordion'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Accordion</span><span style="color: #009900;">&#40;</span>
		<span style="color: #009900;">&#123;</span>
		headerSelector<span style="color: #339933;">:</span> <span style="color: #3366CC;">'dt'</span><span style="color: #339933;">,</span>
		panelSelector  <span style="color: #339933;">:</span> <span style="color: #3366CC;">'dd'</span><span style="color: #339933;">,</span>
		activeClass  <span style="color: #339933;">:</span> <span style="color: #3366CC;">'my_AccordionActive'</span><span style="color: #339933;">,</span>
		hoverClass  <span style="color: #339933;">:</span> <span style="color: #3366CC;">'my_AccordionHover'</span><span style="color: #339933;">,</span>
		panelHeight  <span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">,</span>
		speed     <span style="color: #339933;">:</span> <span style="color: #CC0000;">300</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>
&nbsp;
&nbsp;
<span style="color: #339933;">&lt;</span>dl id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;my_Accordion&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>dt <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;aquiAlgunaClase&quot;</span><span style="color: #339933;">&gt;</span>Titulo <span style="color: #CC0000;">1</span><span style="color: #339933;">&lt;/</span>dt<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>dd<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Lorem ipsum dolor sit amet<span style="color: #339933;">,</span> consectetuer adipiscing elit. <span style="color: #660066;">Vestibulum</span> odio urna<span style="color: #339933;">,</span> 
hendrerit ac<span style="color: #339933;">,</span> nonummy et<span style="color: #339933;">,</span> tempor commodo<span style="color: #339933;">,</span> eros. <span style="color: #660066;">Etiam</span> ac dui id lectus imperdiet euismod. 
<span style="color: #000066; font-weight: bold;">In</span> vitae est. <span style="color: #660066;">Nunc</span> quis lacus. <span style="color: #660066;">Aenean</span> convallis. <span style="color: #660066;">Aliquam</span> erat volutpat. <span style="color: #660066;">Aliquam</span> justo eros<span style="color: #339933;">,</span> tristique sit 
amet<span style="color: #339933;">,</span> fringilla et<span style="color: #339933;">,</span> bibendum ac<span style="color: #339933;">,</span> arcu. <span style="color: #660066;">Nulla</span> <span style="color: #000066; font-weight: bold;">in</span> lacus non lectus volutpat vehicula. <span style="color: #660066;">Sed</span> non magna imperdiet 
nisi pharetra ullamcorper. <span style="color: #660066;">Nullam</span> quis quam.<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Ut quis massa. <span style="color: #660066;">Vestibulum</span> ante ipsum primis <span style="color: #000066; font-weight: bold;">in</span> faucibus orci luctus et ultrices posuere cubilia Curae<span style="color: #339933;">;</span> 
Aenean nunc ligula<span style="color: #339933;">,</span> egestas <span style="color: #000066; font-weight: bold;">in</span><span style="color: #339933;">,</span> dictum a<span style="color: #339933;">,</span> porttitor <span style="color: #000066; font-weight: bold;">in</span><span style="color: #339933;">,</span> pede. <span style="color: #660066;">Curabitur</span> blandit faucibus massa. 
<span style="color: #660066;">Aliquam</span> nonummy laoreet libero. <span style="color: #660066;">Phasellus</span> euismod erat eu risus. <span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>dd<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>dt <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;aquiAlgunaClase&quot;</span><span style="color: #339933;">&gt;</span>Titulo <span style="color: #CC0000;">2</span><span style="color: #339933;">&lt;/</span>dt<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>dd<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Ut quis massa. <span style="color: #660066;">Vestibulum</span> ante ipsum primis <span style="color: #000066; font-weight: bold;">in</span> faucibus orci luctus et ultrices posuere 
cubilia Curae<span style="color: #339933;">;</span> Aenean nunc ligula<span style="color: #339933;">,</span> egestas <span style="color: #000066; font-weight: bold;">in</span><span style="color: #339933;">,</span> dictum a<span style="color: #339933;">,</span> porttitor <span style="color: #000066; font-weight: bold;">in</span><span style="color: #339933;">,</span> pede. <span style="color: #660066;">Curabitur</span> blandit 
faucibus massa. <span style="color: #660066;">Aliquam</span> nonummy laoreet libero. <span style="color: #660066;">Phasellus</span> euismod erat eu risus. <span style="color: #660066;">Ut</span> placerat 
egestas risus. <span style="color: #660066;">Donec</span> nisl nibh<span style="color: #339933;">,</span> aliquam vel<span style="color: #339933;">,</span> porttitor non<span style="color: #339933;">,</span> condimentum quis<span style="color: #339933;">,</span> risus. <span style="color: #660066;">Vestibulum</span> 
eleifend vulputate lectus. <span style="color: #660066;">Aliquam</span> id turpis. <span style="color: #660066;">Aliquam</span> erat volutpat.<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>dd<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>dt <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;aquiAlgunaClase&quot;</span><span style="color: #339933;">&gt;</span>Titulo <span style="color: #CC0000;">3</span><span style="color: #339933;">&lt;/</span>dt<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>dd<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Nulla lorem lacus<span style="color: #339933;">,</span> congue nec<span style="color: #339933;">,</span> suscipit nec<span style="color: #339933;">,</span> hendrerit sit amet<span style="color: #339933;">,</span> lorem. <span style="color: #660066;">Vestibulum</span> dolor. 
<span style="color: #660066;">Donec</span> et ante et massa mollis sagittis. <span style="color: #660066;">Nullam</span> elementum cursus justo. <span style="color: #660066;">Proin</span> leo ante<span style="color: #339933;">,</span> consequat 
eu<span style="color: #339933;">,</span> tincidunt ac<span style="color: #339933;">,</span> consectetuer ac<span style="color: #339933;">,</span> massa. <span style="color: #660066;">Cras</span> dictum. <span style="color: #660066;">Aliquam</span> quis enim. <span style="color: #660066;">Quisque</span> ac magna 
et lorem porta tincidunt. <span style="color: #660066;">Fusce</span> nulla. <span style="color: #660066;">Praesent</span> euismod sagittis mauris. <span style="color: #660066;">Curabitur</span> eu nisl. <span style="color: #660066;">Duis</span> purus. 
<span style="color: #660066;">Pellentesque</span> justo nibh<span style="color: #339933;">,</span> mattis non<span style="color: #339933;">,</span> sollicitudin a<span style="color: #339933;">,</span> aliquam vitae<span style="color: #339933;">,</span> urna. <span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>dd<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>dt <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;aquiAlgunaClase&quot;</span><span style="color: #339933;">&gt;</span>Titulo <span style="color: #CC0000;">4</span><span style="color: #339933;">&lt;/</span>dt<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>dd<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Etiam mi justo<span style="color: #339933;">,</span> accumsan a<span style="color: #339933;">,</span> scelerisque auctor<span style="color: #339933;">,</span> tempus sed<span style="color: #339933;">,</span> enim. <span style="color: #660066;">Vivamus</span> tristique ipsum 
quis lectus. <span style="color: #660066;">Cras</span> nec lectus. <span style="color: #660066;">Duis</span> luctus convallis massa. <span style="color: #660066;">Ut</span> augue enim<span style="color: #339933;">,</span> aliquam vel<span style="color: #339933;">,</span> posuere 
accumsan<span style="color: #339933;">,</span> bibendum ut<span style="color: #339933;">,</span> leo. <span style="color: #660066;">Nunc</span> sed purus. <span style="color: #000066; font-weight: bold;">In</span> vel neque. <span style="color: #660066;">Donec</span> lobortis<span style="color: #339933;">,</span> tellus at dignissim porta<span style="color: #339933;">,</span> 
ante sapien facilisis nibh<span style="color: #339933;">,</span> non ullamcorper dolor purus <span style="color: #000066; font-weight: bold;">in</span> urna. <span style="color: #660066;">Nulla</span> libero. <span style="color: #660066;">Nulla</span> eget est. <span style="color: #660066;">Quisque</span> 
est mauris<span style="color: #339933;">,</span> semper at<span style="color: #339933;">,</span> tincidunt et<span style="color: #339933;">,</span> lacinia sed<span style="color: #339933;">,</span> ligula.<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>dd<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>dl<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Como veis he puesto algunos comentarios para que podais enteraros un poco como rula el codigo,  podria resaltar que la parte mas importante es donde se definen los valores de los parametros que necesitamos para crear el efecto</p>
<pre>
headerSelector: 'dt',
panelSelector  : 'dd',
activeClass  : 'my_AccordionActive',
hoverClass  : 'my_AccordionHover',
panelHeight  : 200,
speed   : 300
</pre>
<p>Quiza pueda surgir una pregunta, ¿Podremos usara otro tipo de listas como OL o LI? la respuesta es SI, o ¿podre usar capas?, pues tambien, pero tendreis que adaptarlo un poco a los requerimientos de la libreria. Pero para evitar tanto jaleo os mostrare otros ejemplos, pero antes miren el ejemplo..</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/accordion/accordion.htm">ver ejemplo</a></p>
<hr />
<h2>Acordion con toggle</h2>
<p>Si lo que quieren es darle esquinazo a la Interface, podeis usar Jquery puro y duro claro con toggle, este metodo ya lo habiamos visto en anteriores posts&#8230; asi que veremos ahora como aplicarlo para crear el efecto acordion.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p203code45'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p20345"><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" id="p203code45"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<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>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.head'</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: #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: #660066;">slideToggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><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;">toggleClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;titActivo2&quot;</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;">&#41;</span>.<span style="color: #660066;">next</span><span style="color: #009900;">&#40;</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;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
a<span style="color: #009900;">&#123;</span>
  color<span style="color: #339933;">:</span>black<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
.<span style="color: #660066;">titActivo2</span><span style="color: #009900;">&#123;</span>
    color<span style="color: #339933;">:</span> green<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;accordion&quot;</span><span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #339933;">&gt;</span>Titulo <span style="color: #CC0000;">1</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>Contenido <span style="color: #CC0000;">1</span><span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #339933;">&gt;</span>Titulo <span style="color: #CC0000;">2</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>Contenido <span style="color: #CC0000;">2</span><span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/accordion/accordion2.htm">ver ejemplo</a></p>
<hr />
Si ya habeis visto los posts anteriores este codigo no necesita mas aclaracion , pero porsiacaso, os dejo la parte mas importante que debe quedar clara.</p>
<pre>
$(this).next().slideToggle('slow');
$(this).toggleClass("titActivo2");
</pre>
<p>la primera linea nos indica que el elemento siguiente sera afectado por el metodo slideToggle con una velocidad de desplazamiento suave, y que el actual elemento (osea el seleccionado) cambiara de estilo para darle una apariencia de activo, como vereis en el ejemplo. Este codigo si es completamente personalizable, y os recomiendo usarlo con DIV, la unica desventaja es que no podeis definir una capa como ACTIVA al comenzar o si encontrais la forma, ya sabeis donde ponerla, &#8220;el los comentarios quillo!!&#8221;.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/accordion/accordion2.htm">ver ejemplo</a></p>
<hr />
<h2>Acordion con UI</h2>
<p>Esto sera solo una introduccion a la libreria UI de Jquery, y comenzaremos con la creacion del efecto Acordion, los scripts se cargan remotamente de los repositorios oficiales de JQuery UI, posteriormete publicare un post tratando el resto de plugins y widgets de esta libreria, la personalizacion de este efecto es algo complejo, pero utilizando CSS &#8220;a pelo&#8221; se puede personalizar, yo prefiero usar Jquery &#8220;a pelo&#8221; pero para gustos&#8230;&#8230;..</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p203code46'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p20346"><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
</pre></td><td class="code" id="p203code46"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
 <span style="color: #339933;">&lt;!--</span> ultima version de los Scripts y CSS que puedes utilizar de estos repositorios o descargartelos <span style="color: #339933;">--&gt;</span>
  <span style="color: #339933;">&lt;</span>link type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://jqueryui.com/latest/themes/base/ui.all.css&quot;</span> rel<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;stylesheet&quot;</span> <span style="color: #339933;">/&gt;</span>
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://jqueryui.com/latest/jquery-1.3.2.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://jqueryui.com/latest/ui/ui.core.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://jqueryui.com/latest/ui/ui.accordion.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
 <span style="color: #339933;">&lt;!--</span> <span style="color: #339933;">--&gt;</span>
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#accordion&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">accordion</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009966; font-style: italic;">/*Solo esto es necesario para realizar el efecto con las caracteristicas por defecto */</span>
    <span style="color: #009966; font-style: italic;">/* Esto ya es de mi cosecha*/</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;h3&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'background'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'url(js/AccordionTab2.gif)'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;h3&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>$<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;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'background'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'url(js/AccordionTab0.gif)'</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: #339933;">,</span>
        <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'background'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'url(js/AccordionTab2.gif)'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;font-size:60%;&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;accordion&quot;</span> style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;width:40%;&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>h3 id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;titulo&quot;</span><span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Titulo <span style="color: #CC0000;">1</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>h3<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>
		Mauris mauris ante<span style="color: #339933;">,</span> blandit et<span style="color: #339933;">,</span> ultrices a<span style="color: #339933;">,</span> suscipit eget<span style="color: #339933;">,</span> quam. <span style="color: #660066;">Integer</span>
		ut neque. <span style="color: #660066;">Vivamus</span> nisi metus<span style="color: #339933;">,</span> molestie vel<span style="color: #339933;">,</span> gravida <span style="color: #000066; font-weight: bold;">in</span><span style="color: #339933;">,</span> condimentum sit
		amet<span style="color: #339933;">,</span> nunc. <span style="color: #660066;">Nam</span> a nibh. <span style="color: #660066;">Donec</span> suscipit eros. <span style="color: #660066;">Nam</span> mi. <span style="color: #660066;">Proin</span> viverra leo ut
		odio. <span style="color: #660066;">Curabitur</span> malesuada. <span style="color: #660066;">Vestibulum</span> a velit eu ante scelerisque vulputate.
		<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>h3 id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;titulo&quot;</span><span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Titulo <span style="color: #CC0000;">2</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>h3<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>
		Sed non urna. <span style="color: #660066;">Donec</span> et ante. <span style="color: #660066;">Phasellus</span> eu ligula. <span style="color: #660066;">Vestibulum</span> sit amet
		purus. <span style="color: #660066;">Vivamus</span> hendrerit<span style="color: #339933;">,</span> dolor at aliquet laoreet<span style="color: #339933;">,</span> mauris turpis porttitor
		velit<span style="color: #339933;">,</span> faucibus interdum tellus libero ac justo. <span style="color: #660066;">Vivamus</span> non quam. <span style="color: #000066; font-weight: bold;">In</span>
		suscipit faucibus urna.
		<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>h3 id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;titulo&quot;</span><span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Titulo <span style="color: #CC0000;">3</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>h3<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>
		Nam enim risus<span style="color: #339933;">,</span> molestie et<span style="color: #339933;">,</span> porta ac<span style="color: #339933;">,</span> aliquam ac<span style="color: #339933;">,</span> risus. <span style="color: #660066;">Quisque</span> lobortis.
		<span style="color: #660066;">Phasellus</span> pellentesque purus <span style="color: #000066; font-weight: bold;">in</span> massa. <span style="color: #660066;">Aenean</span> <span style="color: #000066; font-weight: bold;">in</span> pede. <span style="color: #660066;">Phasellus</span> ac libero
		ac tellus pellentesque semper. <span style="color: #660066;">Sed</span> ac felis. <span style="color: #660066;">Sed</span> commodo<span style="color: #339933;">,</span> magna quis
		lacinia ornare<span style="color: #339933;">,</span> quam ante aliquam nisi<span style="color: #339933;">,</span> eu iaculis leo purus venenatis dui.
		<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>ul<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span>List <span style="color: #000066; font-weight: bold;">item</span> one<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span>List <span style="color: #000066; font-weight: bold;">item</span> two<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span>List <span style="color: #000066; font-weight: bold;">item</span> three<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/accordion/accordion3.htm">ver ejemplo</a></p>
<hr />
<p>Pues ya decidireis cual usar, yo es que aun no me decido, depende del proyecto y del tiempo que tenga, pero definitivamente mola mas personalizar el efecto lo mas posible, en un siguiente post seguire tratando de este tema con otros plugins del Jquery</p>
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=203</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tooltip con Interface Jquery</title>
		<link>http://josesuarezcordova.com/?p=190</link>
		<comments>http://josesuarezcordova.com/?p=190#comments</comments>
		<pubDate>Mon, 08 Jun 2009 07:09:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[efectos Jquery]]></category>
		<category><![CDATA[español]]></category>
		<category><![CDATA[jose suarez]]></category>
		<category><![CDATA[tooltip con Jquery]]></category>
		<category><![CDATA[tutorial español]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=190</guid>
		<description><![CDATA[
publicidad


Muy buenas amigos del Jquery, veremos ahora como crear un sencillo efecto de tooltip sobre un enlace, para esto utilizaremos la libreria interface.js y porsupuesto jquery.js, el efecto lo podeis aplicar en cualquier elemento como enlace, por ejemplo para describir detalles de productos o dar mas informacion sobre un enlace o elemento de la pagina.
Las [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Muy buenas amigos del Jquery, veremos ahora como crear un sencillo efecto de tooltip sobre un enlace, para esto utilizaremos la libreria interface.js y porsupuesto jquery.js, el efecto lo podeis aplicar en cualquier elemento como enlace, por ejemplo para describir detalles de productos o dar mas informacion sobre un enlace o elemento de la pagina.</p>
<p><a href="http://josesuarezcordova.com/ejemplosJquery/tooltip/">Las librerias a utilizar las podeis descargar desde aqui</a></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p190code48'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p19048"><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
</pre></td><td class="code" id="p190code48"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/interface.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tooltip'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'opacity'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span>
			<span style="color: #3366CC;">'mouseover'</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: #009900;">&#40;</span><span style="color: #3366CC;">'#tooltip'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">stopAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">pause</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #339933;">,</span><span style="color: #CC0000;">1</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: #660066;">bind</span><span style="color: #009900;">&#40;</span>
			<span style="color: #3366CC;">'mouseout'</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: #009900;">&#40;</span><span style="color: #3366CC;">'#tooltip'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">stopAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</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: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</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;">&#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: #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>
&nbsp;
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span><span style="color: #339933;">&gt;</span>
	#tooltip
	<span style="color: #009900;">&#123;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #bb0<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 2px dotted #bbb<span style="color: #339933;">;</span>
	padding<span style="color: #339933;">:</span> 15px<span style="color: #339933;">;</span>
	color<span style="color: #339933;">:</span> #fff<span style="color: #339933;">;</span>
	width<span style="color: #339933;">:</span> 200px<span style="color: #339933;">;</span>
	display<span style="color: #339933;">:</span> none<span style="color: #339933;">;</span>
             text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span>center<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Amigo de Jquery<span style="color: #339933;">,</span> pasa el puntero por aqui<span style="color: #339933;">!&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;tooltip&quot;</span><span style="color: #339933;">&gt;&lt;</span>b<span style="color: #339933;">&gt;</span>Mensaje<span style="color: #339933;">&lt;/</span>b<span style="color: #339933;">&gt;</span> descriptivo del enlace<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Como vereis, hago uso del metodo &#8220;.bind&#8221; para administrar los eventos, &#8220;mouseover&#8221; y &#8220;mouseout&#8221; que realizaran el efecto mostrar/ocultra de la capa &#8220;tooltip&#8221;, la misma que al cargar la pagina aparece oculta &#8220;display:none&#8221;, ademas tambien se agrega un css a la capa &#8220;tooltip&#8221; en caliente por jquery &#8220;opacity:0.1&#8243;. Podeis ver tambien que se hace uso de &#8220;fadeTo(400,1);&#8221; esto se podria leer como &#8220;hazlo completamente transparente en 400 milisegundos&#8221;, este metodo es muy util cuando queremos simular los efectos de transparencia en un intervalo de tiempo, podriamos decir que esto es una trampa que se le hace a la libreria correspondiente para hacer el efecto tooltip con Jquery pero es una buena solucion, posteriormente publicare un post utilizando la libreria correspondiente para tunear mas los tooltip.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tooltip/tooltip.htm">ver ejemplo</a></p>
<hr />
<p><!--Script google --><br />
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><br />
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8693724-1");
pageTracker._trackPageview();
} catch(err) {}</script></p>
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=190</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Efecto drag &amp; drop con Jquery Interface</title>
		<link>http://josesuarezcordova.com/?p=175</link>
		<comments>http://josesuarezcordova.com/?p=175#comments</comments>
		<pubDate>Wed, 03 Jun 2009 07:37:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[arrastrar y soltar]]></category>
		<category><![CDATA[drag]]></category>
		<category><![CDATA[drag & drop]]></category>
		<category><![CDATA[efecto drag]]></category>
		<category><![CDATA[efectos Jquery]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[jose suarez]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=175</guid>
		<description><![CDATA[
publicidad


Hola denuevo Amigos del Jquery, ahora tratare una interesante libreria, la Interface de Jquery es un conjunto de librerias que permiten realizar efectos bastante interesantes que podemos utilizar de distinas formas, en este post veremos las diferentes formas que tiene la libreria idrag.js que es un plugin de la libreria iutil.js .
Descargate las librerias
Drag simple [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Hola denuevo Amigos del Jquery, ahora tratare una interesante libreria, la Interface de Jquery es un conjunto de librerias que permiten realizar efectos bastante interesantes que podemos utilizar de distinas formas, en este post veremos las diferentes formas que tiene la libreria idrag.js que es un plugin de la libreria iutil.js .</p>
<p><a href="http://josesuarezcordova.com/ejemplosJquery/interface/js/">Descargate las librerias</a></p>
<h3>Drag simple </h3>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p175code57'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p17557"><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
</pre></td><td class="code" id="p175code57"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/iutil.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/idrag.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#drag1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Draggable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>snapDistance<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> frameClass<span style="color: #339933;">:</span> <span style="color: #3366CC;">'frameClass'</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>
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
.<span style="color: #660066;">draggable</span> <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	width<span style="color: #339933;">:</span> 80px<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> 40px<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 1px solid #0090DF<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #FFA800<span style="color: #339933;">;</span>
	padding<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
	text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span> center<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;drag1&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;draggable&quot;</span><span style="color: #339933;">&gt;</span>Arrastrame<span style="color: #339933;">!!&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>En este ejemplo, primero debemos, como siempre importar las librerias a utilizar que la podeis descargar de cualquier parte o en su defecto desde el enlace superior, suguiero descargarlo desde los enlaces que deje arriba, pues podria ocurrir que al bajarlo de otro sitio no actualizado, tenga efectos raros en IE. Bueno una vez importadas las librerias, creamos una clase de estilo (no  es necesario, pero asi pude definir el area de la capa que se arrastrara), luego creamos la capa que contiene el parrafo o contenido que se va a arrastrar con la ID que usaremos en el script, esto si es importante.</p>
<p>El script que &#8220;hace la magia&#8221; puede estar antes o despues de la capa, osea en el HEAD o en el BODY, lo suyo seria que este en un fichero js externo.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/interface/drag1.htm">ver ejemplo</a></p>
<hr />
<h3>Drag con desplazamiento</h3>
<p>Si el ejemplo anterior te parecio muy cutre, este ejemplo quiza te mole mas, ahora trabajando con algunos parametros podemos controlar el efecto de ghosting, asi como la velocidad y efecto de opacidad para crear el desplazamiento de la capa, veamos y luego me cuentas.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p175code58'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p17558"><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
</pre></td><td class="code" id="p175code58"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/iutil.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/idrag.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#drag2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Draggable</span><span style="color: #009900;">&#40;</span>
		<span style="color: #009900;">&#123;</span>
		ghosting<span style="color: #339933;">:</span>	<span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
		opacity<span style="color: #339933;">:</span><span style="color: #CC0000;">0.5</span><span style="color: #339933;">,</span>
		fx<span style="color: #339933;">:</span><span style="color: #CC0000;">300</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>
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
.<span style="color: #660066;">draggable</span> <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	width<span style="color: #339933;">:</span> 100px<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> 40px<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 1px solid #0090DF<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #FFA800<span style="color: #339933;">;</span>
	text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span> center<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;drag2&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;draggable&quot;</span><span style="color: #339933;">&gt;</span>Desplazamiento<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/interface/drag2.htm">ver ejemplo</a></p>
<hr />
<h3>Drag con efecto Volver</h3>
<p>Ahora veamos un ejemplo de como hacer para que la capa vuelva a su estado original al ser arrastrado, utilizamos el parametro revert tal y como lo vemos a continuacion.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p175code59'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p17559"><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
</pre></td><td class="code" id="p175code59"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/iutil.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/idrag.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#drag3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Draggable</span><span style="color: #009900;">&#40;</span>
			<span style="color: #009900;">&#123;</span>
				revert<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
				fx<span style="color: #339933;">:</span><span style="color: #CC0000;">100</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>
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
.<span style="color: #660066;">draggable</span> <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	width<span style="color: #339933;">:</span> 100px<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> 40px<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 1px solid #0090DF<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #FFA800<span style="color: #339933;">;</span>
	text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span> center<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;drag3&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;draggable&quot;</span><span style="color: #339933;">&gt;</span>Efecto Volver<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Ahi vemos un parametro ya conocido, &#8220;fx&#8221; que mide la velocidad de desplazamiento y el parametro &#8220;revert&#8221; que hace la magia..</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/interface/drag3.htm">ver ejemplo</a></p>
<hr />
<h3>Drag con desplazamiento fijo</h3>
<p>Veamos ahora un ejemplo de desplazamiento fijo, esto quiere decir un desplazamiento estableciendo una distancia fija en el plano cartesiano x,y. Para este ejemplo se utiliza el parametro &#8220;grid&#8221;.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p175code60'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p17560"><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
</pre></td><td class="code" id="p175code60"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/iutil.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/idrag.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#drag4'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Draggable</span><span style="color: #009900;">&#40;</span>
			<span style="color: #009900;">&#123;</span>
				grid<span style="color: #339933;">:</span>		<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">100</span><span style="color: #339933;">,</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#93;</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>
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
.<span style="color: #660066;">draggable</span> <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	width<span style="color: #339933;">:</span> 100px<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> 40px<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 1px solid #0090DF<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #FFA800<span style="color: #339933;">;</span>
	text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span> center<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;drag4&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;draggable&quot;</span><span style="color: #339933;">&gt;</span>Desplazamiento fijo<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/interface/drag4.htm">ver ejemplo</a></p>
<hr />
<h3>Drag con desplazamiento por ejes</h3>
<p>Y que tal si queremos hacer un desplazamiento por ejes, osea vertical u horizontal, solo en uno de los dos ejes claro, para esto usaremos el parametro : axis:&#8217;vertically&#8217; / axis:&#8217;horizontal&#8217;, pero mejor lo vemos en un par de ejemplos.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p175code61'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p17561"><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
</pre></td><td class="code" id="p175code61"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/iutil.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/idrag.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#drag5'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Draggable</span><span style="color: #009900;">&#40;</span>
			<span style="color: #009900;">&#123;</span>
				axis<span style="color: #339933;">:</span>	<span style="color: #3366CC;">'vertically'</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>
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
.<span style="color: #660066;">draggable</span> <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	width<span style="color: #339933;">:</span> 100px<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> 40px<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 1px solid #0090DF<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #FFA800<span style="color: #339933;">;</span>
	text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span> center<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;drag5&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;draggable&quot;</span><span style="color: #339933;">&gt;</span>Desplazamiento Vertical<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/interface/drag5.htm">ver ejemplo</a></p>
<hr />

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p175code62'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p17562"><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
</pre></td><td class="code" id="p175code62"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/iutil.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/idrag.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#drag6'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Draggable</span><span style="color: #009900;">&#40;</span>
			<span style="color: #009900;">&#123;</span>
			axis<span style="color: #339933;">:</span><span style="color: #3366CC;">'horizontally'</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>
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
.<span style="color: #660066;">draggable</span> <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	width<span style="color: #339933;">:</span> 100px<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> 40px<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 1px solid #0090DF<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #FFA800<span style="color: #339933;">;</span>
	text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span> center<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;drag6&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;draggable&quot;</span><span style="color: #339933;">&gt;</span>Desplazamiento Horizontal<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/interface/drag6.htm">ver ejemplo</a></p>
<hr />
<h3>Drag con desplazamiento por Handle</h3>
<p>Veamos ahora como desplazar una capa utilizando otra capa interior como handler.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p175code63'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p17563"><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
</pre></td><td class="code" id="p175code63"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/iutil.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/idrag.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#drag7'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Draggable</span><span style="color: #009900;">&#40;</span>
			<span style="color: #009900;">&#123;</span>
			handle<span style="color: #339933;">:</span><span style="color: #3366CC;">'div'</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>
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
.<span style="color: #660066;">draggable</span> <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	width<span style="color: #339933;">:</span> 100px<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> 40px<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 1px solid #0090DF<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #FFA800<span style="color: #339933;">;</span>
	text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span> center<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
div<span style="color: #009900;">&#123;</span>
  background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #<span style="color: #CC0000;">972501</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;drag7&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;draggable&quot;</span><span style="color: #339933;">&gt;&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;cursor:pointer;&quot;</span><span style="color: #339933;">&gt;&amp;</span>nbsp<span style="color: #339933;">;&lt;/</span>div<span style="color: #339933;">&gt;</span>Drag por handler<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/interface/drag7.htm">ver ejemplo</a></p>
<hr />
<h3>Drag dentro de una capa Contenedora</h3>
<p>Ahora veremos un ejemplo muy interesante, tener una capa contenedora con una capa interior que solo se pueda desplazar dentro del area limitada por su contenedor, para esto utilizamos el parametro containment ademas del z-index que ya sabemos su uso por CSS, pero veamos el ejemplo y les dejo a su libre imaginacion los multiples usos.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p175code64'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p17564"><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
</pre></td><td class="code" id="p175code64"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/iutil.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/idrag.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#insideParent'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">Draggable</span><span style="color: #009900;">&#40;</span>
		<span style="color: #009900;">&#123;</span>
			zIndex<span style="color: #339933;">:</span>	<span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span>
			ghosting<span style="color: #339933;">:</span>	<span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
			opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">0.7</span><span style="color: #339933;">,</span>
			containment <span style="color: #339933;">:</span> <span style="color: #3366CC;">'parent'</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>
&nbsp;
<span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;all&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
#parentElem<span style="color: #009900;">&#123;</span>
	width<span style="color: #339933;">:</span> 450px<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> 150px<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #FFDF00<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 10px solid #FF6600<span style="color: #339933;">;</span>
	padding<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	overflow<span style="color: #339933;">:</span> hidden<span style="color: #339933;">;</span>
	margin<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
	color<span style="color: #339933;">:</span> #000<span style="color: #339933;">;</span>
	border<span style="color: #339933;">-</span>left<span style="color: #339933;">-</span>width<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
#insideParent<span style="color: #009900;">&#123;</span>
	width<span style="color: #339933;">:</span> 50px<span style="color: #339933;">;</span>
	height<span style="color: #339933;">:</span> 50px<span style="color: #339933;">;</span>
	background<span style="color: #339933;">-</span>color<span style="color: #339933;">:</span> #006699<span style="color: #339933;">;</span>
	color<span style="color: #339933;">:</span> #fff<span style="color: #339933;">;</span>
  text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span>center<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;parentElem&quot;</span><span style="color: #339933;">&gt;</span>Capa Contenedora<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;insideParent&quot;</span><span style="color: #339933;">&gt;</span>DRAG<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Muy sencillo verdad?, es que Jquery es lo mas ademas de ser muy facil, tanto que cualquiera con basicos conocimientos de Javascript puede entender que esta pasando ahi. Bueno pero veamos el ejemplo en ejecucion.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/interface/drag8.htm">ver ejemplo</a></p>
<hr />
<p>Bueno, amigos del JQuery espero que estos ejemplos le hallan servido de algo y si tienen alguna experiencia que contar ya saben, dejen vuestros comentarios, o si no les sale el ejemplo o quieren mayor explicacion sobre alguno , igual dejen comentarios <img src='http://josesuarezcordova.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .. Hasta otra!</p>
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=175</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dia 7 : Jquery en 7 dias para no iniciados [Efectos]</title>
		<link>http://josesuarezcordova.com/?p=165</link>
		<comments>http://josesuarezcordova.com/?p=165#comments</comments>
		<pubDate>Mon, 01 Jun 2009 10:04:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[efectos]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[jose suarez]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[slow]]></category>
		<category><![CDATA[toggle]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=165</guid>
		<description><![CDATA[
publicidad


Bueno, este es el ultimo capitulo de este tutorial basico de Jquery para no iniciados, espero que hasta ahora halla sido entendible y si hay alguna observacion o quieran agregar otros temas, puedes enviar un comentario e inmediatamente entraremos en contacto para resolver el tema.
show()
Este metodo permite mostrar algun elemento de la pagina, y como [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Bueno, este es el ultimo capitulo de este tutorial basico de Jquery para no iniciados, espero que hasta ahora halla sido entendible y si hay alguna observacion o quieran agregar otros temas, puedes enviar un comentario e inmediatamente entraremos en contacto para resolver el tema.</p>
<h3>show()</h3>
<p>Este metodo permite mostrar algun elemento de la pagina, y como hasta el momento lo he hestado haciendo, lo mejor es verlo con un ejemplo.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p165code70'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16570"><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
</pre></td><td class="code" id="p165code70"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;button&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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</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;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <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>
  <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  p <span style="color: #009900;">&#123;</span> 
    background<span style="color: #339933;">:</span>yellow<span style="color: #339933;">;</span> 
    color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span>
    padding<span style="color: #339933;">-</span>top<span style="color: #339933;">:</span><span style="color: #CC0000;">2</span><span style="color: #339933;">%;</span>
    padding<span style="color: #339933;">-</span>left<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">%;</span>
    font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>20px<span style="color: #339933;">;</span>
    clear<span style="color: #339933;">:</span>both<span style="color: #339933;">;</span> 
    margin<span style="color: #339933;">:</span>auto<span style="color: #339933;">;</span> 
    width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span> 
    height<span style="color: #339933;">:</span>100px<span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>button<span style="color: #339933;">&gt;</span>Mostrar<span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>p style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;display: none&quot;</span><span style="color: #339933;">&gt;</span>Que pasa quillo<span style="color: #339933;">!&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia7/show.htm">ver ejemplo</a></p>
<hr />
<p>Ahora si queremos darle cierto efecto de aparicion al mostrar el elemento, podemos usar los parametros slow/fast o milisegundos, al metodo show() como vemos en el siguiente ejemplo:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p165code71'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16571"><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" id="p165code71"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#btn1&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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#p1&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//prueba con fast</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#btn2&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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#p2&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">100</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>
&nbsp;
  <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>
  <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  p <span style="color: #009900;">&#123;</span> 
    background<span style="color: #339933;">:</span>yellow<span style="color: #339933;">;</span> 
    color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span>
    padding<span style="color: #339933;">-</span>top<span style="color: #339933;">:</span><span style="color: #CC0000;">2</span><span style="color: #339933;">%;</span>
    padding<span style="color: #339933;">-</span>left<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">%;</span>
    font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>20px<span style="color: #339933;">;</span>
    clear<span style="color: #339933;">:</span>both<span style="color: #339933;">;</span> 
    margin<span style="color: #339933;">:</span>auto<span style="color: #339933;">;</span> 
    width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span> 
    height<span style="color: #339933;">:</span>100px<span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>button id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;btn1&quot;</span><span style="color: #339933;">&gt;</span>Mostrar <span style="color: #CC0000;">1</span><span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>button id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;btn2&quot;</span><span style="color: #339933;">&gt;</span>Mostrar <span style="color: #CC0000;">2</span><span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>p id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;p1&quot;</span> style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;display: none&quot;</span><span style="color: #339933;">&gt;</span>Que pasa quillo<span style="color: #339933;">!&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;p2&quot;</span> style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;display: none&quot;</span><span style="color: #339933;">&gt;</span>Otra vez por aqui<span style="color: #339933;">!&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia7/showSpeed.htm">ver ejemplo</a></p>
<hr />
<h3>Hide()</h3>
<p>Este metodo permite ocultar cualquier elemento de la pagina. Esto puede ser automaticamente o al ocurrir algun evento.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p165code72'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16572"><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" id="p165code72"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&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;">//Ocultara todo lo que tenga la etiqueta p al cargar el documento</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;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: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</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: #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;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <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>
&nbsp;
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Texto oculto al cargar<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Pincha para ocultarme<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia7/hide.htm">ver ejemplo</a></p>
<hr />
<p>Y asi como con show() teniamos un slow/fast aqui lo mismo, veamos un ejemplo.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p165code73'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16573"><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" id="p165code73"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;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: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</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;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <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>
 <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  a<span style="color: #009900;">&#123;</span>
    width<span style="color: #339933;">:</span>350px<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
 <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
 <span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Pincha para ocultarme con efecto to guapo ahi<span style="color: #339933;">!&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia7/hideSpeed.htm">ver ejemplo</a></p>
<hr />
<h3>toggle()</h3>
<p>Este metodo permite ocultar y mostrar un elemento de la pagina, une los metodos show/hide y tambien se puede utilizar slow/fast ademas de otros parametros que veremos.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p165code74'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16574"><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
</pre></td><td class="code" id="p165code74"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#btn1&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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#p1&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2000</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>    
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#btn2&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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#p2&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</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>    
&nbsp;
&nbsp;
  <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>
  <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  p <span style="color: #009900;">&#123;</span> background<span style="color: #339933;">:</span>#dad<span style="color: #339933;">;</span> font<span style="color: #339933;">-</span>weight<span style="color: #339933;">:</span>bold<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>button id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;btn1&quot;</span><span style="color: #339933;">&gt;</span>Pincha aqui nen<span style="color: #339933;">!&lt;/</span>button<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;p1&quot;</span><span style="color: #339933;">&gt;</span>JQuery es lo maximo<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>button id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;btn2&quot;</span><span style="color: #339933;">&gt;</span>Pincha aqui tambien<span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;p2&quot;</span><span style="color: #339933;">&gt;</span>Amigos del Jquery<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia7/toggle.htm">ver ejemplo</a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=165</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dia 6 : Jquery en 7 dias para no iniciados [Eventos][parte3]</title>
		<link>http://josesuarezcordova.com/?p=154</link>
		<comments>http://josesuarezcordova.com/?p=154#comments</comments>
		<pubDate>Fri, 29 May 2009 10:29:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[jose suarez]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[submit]]></category>
		<category><![CDATA[unload]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=154</guid>
		<description><![CDATA[
publicidad


Buenas, sigamos con lo que podria ser el 6to dia de aprendizaje de Jquery para no iniciados, como vereis hasta ahora estoy tocando mucho el tema de los eventos, porque definitivamente son la base para poder controlar cualquier aspecto de la pagina, ademas claro de los distintos plugins que veremos posterioremente en otros post, pero [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Buenas, sigamos con lo que podria ser el 6to dia de aprendizaje de Jquery para no iniciados, como vereis hasta ahora estoy tocando mucho el tema de los eventos, porque definitivamente son la base para poder controlar cualquier aspecto de la pagina, ademas claro de los distintos plugins que veremos posterioremente en otros post, pero prefiero que quede claro todo lo que se puede hacer con el Jquery puro y duro.</p>
<h3>Evento:resize()</h3>
<p>Este metodo permite disparar una accion al detectar el redimensionamiento de la ventana , como siempre en Firefox ira de perlas pero en IE7 el alert posiblemente aparezca dos veces, habra que preguntarle a nuestro &#8220;amigo Bill&#8221;, ¿cuando sacaras del mercado IE?&#8221;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p154code80'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p15480"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p154code80"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">resize</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Pajaro que haces, con cuidaico!&quot;</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>
&nbsp;
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text-align:center;&quot;</span><span style="color: #339933;">&gt;</span> Jquery en Accion<span style="color: #339933;">!!</span> <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia6/resize.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: unload()</h3>
<p>Este metodo permite disparar una accion al cerrar la ventana, por ejemplo lanzar un alert como vemos a continuacion. Las posibilidades son muy amplias, pero si se te esta pasando por la cabeza intentar evitar que el usuario cierre tu pagina, intentalo y si encuentras la solucion postealo inmediatamente porque habrias encontrado el santo grial chiquillo!</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p154code81'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p15481"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p154code81"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unload</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hasta luego majo! :)&quot;</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>
&nbsp;
<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text-align:center;&quot;</span><span style="color: #339933;">&gt;</span> Amigos del JQuery<span style="color: #339933;">!!</span> <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia6/unload.htm">ver ejemplo</a></p>
<hr />
<h3>Evento:submit()</h3>
<p>Este metodo permite realizar una accion presionar el boton submit de un formulario, por ejemplo tratar los datos del formulario antes de enviarlo a algun controlador, este es un ejemplo de lo que puede hacer.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p154code82'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p15482"><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" id="p154code82"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
 $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hola mi arma!'</span><span style="color: #009900;">&#41;</span><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;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'font-size'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'20px'</span><span style="color: #009900;">&#41;</span><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;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ole has enviado argo no se a onde!'</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;">&#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>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;texto&quot;</span>  style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text-align:center;&quot;</span><span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;</span>form<span style="color: #339933;">&gt;</span> 
    <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;submit&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;mibutton&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;pincha aqui chiquillo!&quot;</span><span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Recomiendo poner el return false,  porque sino en IE7 hara un extraño.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia6/submit.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: scroll()</h3>
<p>Este metodo permite disparar alguna accion cuando se hace scroll sobre una capa con overflow, un frame o iframe.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p154code83'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p15483"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p154code83"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
 $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#micapa&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">scroll</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
      <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'que haces chiquillo!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;micapa&quot;</span>  style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text-align:center; overflow:scroll; width:200px; height:200px;&quot;</span><span style="color: #339933;">&gt;</span>
    Lorem ipsum dolor sit amet<span style="color: #339933;">,</span> consectetur adipiscing elit. <span style="color: #660066;">Quisque</span> pellentesque magna nec sem luctus commodo. <span style="color: #660066;">Vivamus</span> a mauris mattis lorem interdum malesuada. <span style="color: #660066;">Integer</span> a bibendum leo. <span style="color: #660066;">Mauris</span> tortor massa<span style="color: #339933;">,</span> suscipit gravida porttitor a<span style="color: #339933;">,</span> convallis auctor massa. <span style="color: #660066;">Cras</span> laoreet lacus sit amet magna sodales porta. <span style="color: #000066; font-weight: bold;">In</span> hac habitasse platea dictumst. <span style="color: #660066;">Vivamus</span> eleifend sodales augue quis consequat. <span style="color: #660066;">Integer</span> eget dui sed nunc consectetur condimentum. <span style="color: #660066;">Donec</span> sagittis consectetur tortor. <span style="color: #660066;">Morbi</span> sagittis dignissim tellus eu egestas.
&nbsp;
    <span style="color: #660066;">Aenean</span> pellentesque enim nec arcu auctor ut vestibulum diam dictum. <span style="color: #660066;">Suspendisse</span> potenti. <span style="color: #660066;">Suspendisse</span> nibh purus<span style="color: #339933;">,</span> ornare ut varius vitae<span style="color: #339933;">,</span> blandit id dui. <span style="color: #000066; font-weight: bold;">In</span> hac habitasse platea dictumst. <span style="color: #660066;">Quisque</span> placerat semper nibh. <span style="color: #660066;">Integer</span> leo tortor<span style="color: #339933;">,</span> faucibus ac lacinia ut<span style="color: #339933;">,</span> pretium <span style="color: #000066; font-weight: bold;">in</span> mi. <span style="color: #660066;">Donec</span> feugiat lectus a nisi consectetur eget ultrices dui laoreet. <span style="color: #660066;">Praesent</span> fermentum mattis felis<span style="color: #339933;">,</span> id molestie velit convallis at. <span style="color: #660066;">Nunc</span> pretium cursus sem<span style="color: #339933;">,</span> vel placerat dolor vehicula a. <span style="color: #660066;">Sed</span> iaculis pulvinar urna<span style="color: #339933;">,</span> sed blandit ipsum sollicitudin quis. <span style="color: #660066;">Cras</span> cursus<span style="color: #339933;">,</span> mi vel feugiat imperdiet<span style="color: #339933;">,</span> dui dui consectetur dui<span style="color: #339933;">,</span> vehicula sagittis dui dui non odio. <span style="color: #660066;">Mauris</span> tincidunt risus et nulla interdum vitae tempor lacus porttitor. <span style="color: #660066;">Suspendisse</span> id ultricies orci. <span style="color: #660066;">Nulla</span> nisl massa<span style="color: #339933;">,</span> elementum nec fringilla <span style="color: #000066; font-weight: bold;">in</span><span style="color: #339933;">,</span> varius sit amet magna. <span style="color: #660066;">Aliquam</span> vel posuere risus. <span style="color: #660066;">Quisque</span> quis vestibulum nibh. <span style="color: #660066;">Quisque</span> ut turpis quis mi hendrerit venenatis. <span style="color: #000066; font-weight: bold;">In</span> hac habitasse platea dictumst. <span style="color: #660066;">Aliquam</span> erat volutpat. 
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia6/rollover.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: select()</h3>
<p>Este metodo permite realizar alguna accion al seleccionar un texto o parrafos.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p154code84'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p15484"><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
</pre></td><td class="code" id="p154code84"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">select</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&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;Has seleccionado el texto&quot;</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: #660066;">fadeOut</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: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <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>
  <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  p <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>blue<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  div <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>
Selecciona alguna palabra o todas del campo.
<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;Jquery AJAX Javascript PHP&quot;</span> size<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;30px&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia6/select.htm">ver ejemplo</a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=154</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dia 5 : Jquery en 7 dias para no iniciados [Eventos][parte2]</title>
		<link>http://josesuarezcordova.com/?p=135</link>
		<comments>http://josesuarezcordova.com/?p=135#comments</comments>
		<pubDate>Thu, 21 May 2009 09:19:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Varios]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jose suarez]]></category>
		<category><![CDATA[keydown]]></category>
		<category><![CDATA[keypress]]></category>
		<category><![CDATA[keyup]]></category>
		<category><![CDATA[mousemove]]></category>
		<category><![CDATA[mouseout]]></category>
		<category><![CDATA[mouseover]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=135</guid>
		<description><![CDATA[
publicidad


Continuo con la explicacion de los mas importantes eventos manejados por Jquery y sus correspondientes ejemplos.
Evento: focus()
Este metodo permite ejecutar una function cuando un elemento de formulario tenga el foco, tiene mucha similitud desde un punto de vista practica con el metodo click, pero no tiene la misma aplicacion.

En este ejemplo se puede ver el [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p>Continuo con la explicacion de los mas importantes eventos manejados por Jquery y sus correspondientes ejemplos.</p>
<h3>Evento: focus()</h3>
<p>Este metodo permite ejecutar una function cuando un elemento de formulario tenga el foco, tiene mucha similitud desde un punto de vista practica con el metodo click, pero no tiene la misma aplicacion.</p>
<p>
En este ejemplo se puede ver el metodo en funcion al pasar del campo usr al pass, que abre un alert al entrar en este ultimo campo, tanto al hacer clic directamente o pasar con el tab.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p135code92'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p13592"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p135code92"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#password&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">id</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; tiene el foco!.&quot;</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> 
&nbsp;
  <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>
&nbsp;
  usr<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;usuario&quot;</span><span style="color: #339933;">&gt;</span>
  pass<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;password&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;password&quot;</span> <span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia5/focus.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: keydown():</h3>
<p>Este metodo ejecuta una funcion al presionar una tecla, por ejemplo si queremos realizar alguna accion o conjunto de acciones para determinada tecla.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p135code93'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p13593"><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" id="p135code93"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Presiona la tecla M'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keydown</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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">keyCode</span><span style="color: #339933;">==</span><span style="color: #3366CC;">'77'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Muy bien la M tiene keyCode: '</span><span style="color: #339933;">+</span> e.<span style="color: #660066;">keyCode</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;">else</span><span style="color: #009900;">&#123;</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;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Que NOOO!!, presiona la tecla M'</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>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #339933;">/&gt;</span></pre></td></tr></table></div>

<p>Para IE presenta dificultades, como siempre IE poniendo trabas al progreso.</br></p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia5/keydown.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: keypress()</h3>
<p>Tiene similar funcionalidad que el metodo keydown(). Este ejemplo es un poco mas complejo, pues solo permite imprimir en la pagina, caracteres alfabetico inclusive la Ññ, pero no simbolos especiales o numeros.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p135code94'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p13594"><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" id="p135code94"><pre class="javascript" style="font-family:monospace;"> <span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keypress</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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">which</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">32</span> <span style="color: #339933;">||</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">209</span> <span style="color: #339933;">||</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">==</span><span style="color: #CC0000;">241</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">65</span> <span style="color: #339933;">&lt;=</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">&amp;&amp;</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">65</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">25</span><span style="color: #009900;">&#41;</span>
                        <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">97</span> <span style="color: #339933;">&lt;=</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">&amp;&amp;</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">97</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">25</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> c <span style="color: #339933;">=</span> String.<span style="color: #660066;">fromCharCode</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">which</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;span/&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
              .<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:last&quot;</span><span style="color: #009900;">&#41;</span>
              .<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">which</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">8</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// backspace in IE only be on keydown</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:last&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#text&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">which</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>
&nbsp;
  <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>
&nbsp;
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  input <span style="color: #009900;">&#123;</span> margin<span style="color: #339933;">:</span>10px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  p <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>blue<span style="color: #339933;">;</span> margin<span style="color: #339933;">:</span>10px<span style="color: #339933;">;</span> font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>18px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  p.<span style="color: #660066;">hilite</span> <span style="color: #009900;">&#123;</span> background<span style="color: #339933;">:</span>yellow<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  div <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
Imprime los caracteres alfabeticos no acentuados<span style="color: #339933;">&lt;</span>br<span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Texto escrito <span style="color: #339933;">-</span> <span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>Keycode<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>span id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span><span style="color: #339933;">&gt;&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia5/keypress.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: keyup()</h3>
<p>La funcion es similar que el keypress(), solo que funcionara cuando se suelte la tecla presionada.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p135code95'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p13595"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p135code95"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span>window<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;">&quot;#contenido&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">keyCode</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>
&nbsp;
  <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>
amigo de Jquery<span style="color: #339933;">,</span> presiona una tecla para ver su keycode
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;contenido&quot;</span><span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia6/keyup.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: mousedown(), mouseup()</h3>
<p>Este metodo permite realizar acciones al presionar o soltar el boton del mouse al hacer clic.
<p>
El ejemplo es muy sencillo de asimilar.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p135code96'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p13596"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p135code96"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
 $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#contenido&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">mouseup</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span style=&quot;color:#F00;&quot;&gt;Mouseup.&lt;/span&gt;'</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: #660066;">mousedown</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;span style=&quot;color:#00F;&quot;&gt;Mousedown.&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
Amigos del Jquery prueben esto<span style="color: #339933;">:</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;contenido&quot;</span><span style="color: #339933;">&gt;</span>Presiona y suelta el mouse aqui. <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia5/mousedownup.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: mousemove() </h3>
<p>Este metodo realiza acciones al detectar actividad del mouse sobre una capa o elemento de la pagina, por ejemplo capturar la ubicacion del puntero sobre una capa como en este ejemplo.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p135code97'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p13597"><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
</pre></td><td class="code" id="p135code97"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#cuadro&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">mousemove</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: #003366; font-weight: bold;">var</span> pageCoords <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;( &quot;</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">pageX</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;, &quot;</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">pageY</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; )&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> clientCoords <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;( &quot;</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">clientX</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;, &quot;</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">clientY</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; )&quot;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span:first&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;( e.pageX, e.pageY ) - &quot;</span> <span style="color: #339933;">+</span> pageCoords<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span:last&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;( e.clientX, e.clientY ) - &quot;</span> <span style="color: #339933;">+</span> clientCoords<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>
&nbsp;
  <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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  #cuadro <span style="color: #009900;">&#123;</span> width<span style="color: #339933;">:</span>100px<span style="color: #339933;">;</span> height<span style="color: #339933;">:</span>150px<span style="color: #339933;">;</span> margin<span style="color: #339933;">:</span>10px<span style="color: #339933;">;</span> margin<span style="color: #339933;">-</span>right<span style="color: #339933;">:</span>50px<span style="color: #339933;">;</span>
        background<span style="color: #339933;">:</span>yellow<span style="color: #339933;">;</span> border<span style="color: #339933;">:</span>2px groove<span style="color: #339933;">;</span> float<span style="color: #339933;">:</span>right<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  p <span style="color: #009900;">&#123;</span> margin<span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> margin<span style="color: #339933;">-</span>left<span style="color: #339933;">:</span>10px<span style="color: #339933;">;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>250px<span style="color: #339933;">;</span>
      height<span style="color: #339933;">:</span>120px<span style="color: #339933;">;</span> padding<span style="color: #339933;">-</span>top<span style="color: #339933;">:</span>70px<span style="color: #339933;">;</span>
      float<span style="color: #339933;">:</span>left<span style="color: #339933;">;</span> font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>14px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  span <span style="color: #009900;">&#123;</span> display<span style="color: #339933;">:</span>block<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;float:left; width:300px;&quot;</span><span style="color: #339933;">&gt;</span>
    Haga scrolling.
    <span style="color: #339933;">&lt;</span>span<span style="color: #339933;">&gt;</span>Mueva el raton sobre la capa.<span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>span<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;cuadro&quot;</span> style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;float:left;&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia5/mousemove.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: mouseover / mouseout()</h3>
<p>Este metodo como ya se os lo imaginais, permite disparar acciones al pasar o quitar el puntero sobre un elemento de la pagina, es una version ampliada del metodo hover(), que ya he revisado anteriormente, para algunos es mas &#8220;personalizado&#8221; utilizar estos metodos para tener mayor control sobre cada accion, y para otros es mas practico usar hover(), cada quien que lo use como mejor le parezca.</p>
<p>
Bueno veamos el ejemplo, facil de realizar pero con muchas projecciones.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p135code98'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p13598"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p135code98"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
   $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">mouseover</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'background-color'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'#ff0'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'font-size'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'25px'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;amigos del Jquery!&quot;</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: #660066;">mouseout</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'background-color'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'#ccc'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'font-size'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'18px'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Jquery YA!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;texto&quot;</span> <span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;estilo1&quot;</span><span style="color: #339933;">&gt;</span>Jquery YA<span style="color: #339933;">!&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia5/mouseoutmouseover.htm">ver ejemplo</a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=135</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dia 4 : Jquery en 7 dias para no iniciados [Eventos][parte1]</title>
		<link>http://josesuarezcordova.com/?p=101</link>
		<comments>http://josesuarezcordova.com/?p=101#comments</comments>
		<pubDate>Tue, 05 May 2009 15:47:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Varios]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[blur]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[click]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dblclick]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[eventos jquery]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[jquery error]]></category>
		<category><![CDATA[manual jquery]]></category>
		<category><![CDATA[onmouseout]]></category>
		<category><![CDATA[onmouseover]]></category>
		<category><![CDATA[toggle]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=101</guid>
		<description><![CDATA[
publicidad


css(propiedad)
con este metodo obtenemos el valor de un atributo css aplicado a una capa determinada para usarla de distintos modos, por ejemplo aplicarlo dinamicamente en otra capa como veremos en el ejemplo

?View Code JAVASCRIPT1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&#60;script language=&#34;JavaScript&#34; src=&#34;js/jquery.js&#34;&#62;&#60;/script&#62;
&#60;script&#62;
  $&#40;document&#41;.ready&#40;function&#40;&#41;&#123;
    $&#40;&#34;div&#34;&#41;.click&#40;function &#40;&#41; &#123;
      var color = $&#40;this&#41;.css&#40;&#34;background-color&#34;&#41;;
   [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<h3>css(propiedad)</h3>
<p>con este metodo obtenemos el valor de un atributo css aplicado a una capa determinada para usarla de distintos modos, por ejemplo aplicarlo dinamicamente en otra capa como veremos en el ejemplo</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code108'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p101108"><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
</pre></td><td class="code" id="p101code108"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&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: #003366; font-weight: bold;">var</span> color <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;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;background-color&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> tam <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;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;font-size&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#resultado&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;span style='color:&quot;</span> <span style="color: #339933;">+</span>
                         color <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;; font-size:&quot;</span><span style="color: #339933;">+</span> tam <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;'&gt;&quot;</span> <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;JQuery&lt;/span&gt;.&quot;</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>
&nbsp;
  <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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  div <span style="color: #009900;">&#123;</span> width<span style="color: #339933;">:</span>60px<span style="color: #339933;">;</span> height<span style="color: #339933;">:</span>20px<span style="color: #339933;">;</span> margin<span style="color: #339933;">:</span>5px<span style="color: #339933;">;</span> float<span style="color: #339933;">:</span>left<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>span id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;resultado&quot;</span><span style="color: #339933;">&gt;</span>Jquery <span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;background-color:#8899bb; font-size:24px;&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;background-color:#bbff00; font-size:18px;&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;background-color:#123456; font-size:30px;&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;background-color:#bbdd88; font-size:10px;&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>
Como vereis, los valores de los atributos del estilo aplicado en cada una de las capas son recuperados como variables con Jquery y desde ahi se utiliza como atributo para aplicarlo a la primera capa, funcionara haciendo clic en cada una de las capas inferiores.
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia4/ejemplo_css/">ver ejemplo</a></p>
<p>Veamos otro ejemplo con este metodo.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code109'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p101109"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code" id="p101code109"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">mouseover</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;background-color&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;yellow&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;font-weight&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;bolder&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;font-size&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;30px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">mouseout</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;font-size&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;14px&quot;</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>
&nbsp;
  <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>
  <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
    p <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>100px<span style="color: #339933;">;</span> font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>14px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>
    JQuery Online
  <span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>En este ejemplo se utiliza el evento onmouseout y onmouseover para cambiar la apariencia del parrafo al ocurrir dichos eventos.  Posteriormente veremos a mas detalle el manejo de eventos con Jquery pero para este ejemplo lo visto es suficiente.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia4/ejemplo_css/index2.htm"> ver ejemplo</a></p>
<hr />
<h3>Evento : hover(sobre, salir)</h3>
<p>Esta funcion permite realizar una accion sobre un elemento al pasar y sacar el puntero del mouse, resume lo que hacemos con los eventos onmouseover y onmouseout. Como veis en el titulo, la sintaxis es muy sencilla, tiene dos parametros que tendran una funcion para realizar ciertas acciones tanto al pasar sobre el elemento como al quitar el puntero.</p>
<p>
Veamos un ejemplo</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code110'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p101110"><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
</pre></td><td class="code" id="p101code110"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;li&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>
        $<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;">append</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;span&gt; *&lt;/span&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <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>
        $<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;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span:last&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;li.fade&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>$<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;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><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;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</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>
&nbsp;
  <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>
  <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  ul <span style="color: #009900;">&#123;</span> margin<span style="color: #339933;">-</span>left<span style="color: #339933;">:</span>20px<span style="color: #339933;">;</span> color<span style="color: #339933;">:</span>blue<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  li <span style="color: #009900;">&#123;</span> cursor<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">default</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  span <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>20px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>ul<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span>Jquery<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span>Javascript<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>li <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'fade'</span><span style="color: #339933;">&gt;</span>XHTML<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>li <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'fade'</span><span style="color: #339933;">&gt;</span>CSS<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>En este ejemplo podeis ver que se usan dos funciones que utilizara como parametros el metodo hover, cuando se pasa el puntero sobre un tag li, se dispara el hoven con las siguientes funciones. La primera funcion  </p>
<pre>
function () {
   $(this).append($("<span> *</span>"));
}
</pre>
<p> Es la accion para el evento over, este agrega el tag span, al pasar el puntero sobre el tag li.</p>
<p>
La segunda funcion en la seccion out cuyo codigo</p>
<pre>
function () {
  $(this).find("span:last").remove();
}
</pre>
<p>Permite encontrar el ultimo tag span y removerla.</p>
<p>
Pero cuando se pase el puntero sobre un tag li con class=fade se ejecutaran las siguientes lineas.</p>
<pre>
hover(function(){$(this).fadeOut(100);$(this).fadeIn(500);});
</pre>
<p>El metodo fadeOut() y fadeIn(), que tocare posteriormente, realiza el efecto de aparecer y desaparecer en un lapso de milisegundos establecido como parametro. Como veis en el ejemplo se pueden usar como parametro over,out del hover, tanto funciones como otros metodos.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia4/ejemplo_event/index_hover.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: toggle(fn1,fn2)</h3>
<p>Este metodo trabaja igual que el hover a diferencia que sus acciones se ejecutan al hacer clic, el primer clic ejecuta una accion, el segundo clic servira para restaurar al elemento a su estado original, esta es quiza una de las funciones mas utiles que tiene Jquery y de la que mas uso se le da en distintos proyectos, el ejemplo que vereis es solo una muestra de lo util que puede sernos en cualquier pagina, posteriormente publicar mas posts a nivel avanzado de este  metodo tan util.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code111'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p101111"><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
</pre></td><td class="code" id="p101code111"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</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: #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;">&quot;selected&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <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>
      $<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;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;selected&quot;</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>
&nbsp;
<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>
  <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
    .<span style="color: #660066;">selected</span> <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>blue<span style="color: #339933;">;</span> background<span style="color: #339933;">:</span>yellow<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span> font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>20px<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
    Amigos del Jquery
  <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Aqui vemos dos metodos muy utiles tambien </p>
<pre>
 $(this).addClass("selected");
 $(this).removeClass("selected");
</pre>
<p>como su nombre indica, permite agregar y eliminar una determinada clase.
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia4/ejemplo_toggle/index_toggle.htm">ver ejemplo</a></p>
<hr />
<h3> Evento : blur(fn)</h3>
<p>Este metodo permite ejecutar una funcion al realizar el evento blur() sobre un elemento. Veamos el siguiente ejemplo:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code112'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p101112"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p101code112"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-latest.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</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: #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: #3366CC;">&quot;span&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'inline'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</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: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>span <span style="color: #009900;">&#123;</span>display<span style="color: #339933;">:</span>none<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;</span>span<span style="color: #339933;">&gt;</span>Campo <span style="color: #CC0000;">1</span><span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;password&quot;</span> <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;</span>span<span style="color: #339933;">&gt;</span>Campo <span style="color: #CC0000;">2</span><span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia4/ejemplo_blur/index_blur.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: change()</h3>
<p>Este metodo permite ejecutar una accion, cuando se realice algun cambio en controles de seleccion de formularios, en este ejemplo vereis como se van pintando en un &#8220;div&#8221; las opciones seleccionadas de forma individual o multiple. La variable &#8220;str&#8221; almacena el texto de la opcion seleccionada de la lista.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code113'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p101113"><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
</pre></td><td class="code" id="p101code113"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-latest.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;select&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</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> str <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
          $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;select option:selected&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                str <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;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; &quot;</span><span style="color: #339933;">;</span>
              <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>str<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: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  div <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>select <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;lenguajes&quot;</span> multiple<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;multiple&quot;</span><span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>option<span style="color: #339933;">&gt;</span>JQuery<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>option selected<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;selected&quot;</span><span style="color: #339933;">&gt;</span>AJAX<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>option<span style="color: #339933;">&gt;</span>Javascript<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>option selected<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;selected&quot;</span><span style="color: #339933;">&gt;</span>JAVA<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>option<span style="color: #339933;">&gt;</span>JSP<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>option<span style="color: #339933;">&gt;</span>PHP<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>select<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia4/ejemplo_change/index_change.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: click() </h3>
<p>Este metodo realiza una accion al realizar el evento click, en este ejemplo se ocultaran con efecto slide cada parrafo conforme se va haciendo click.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code114'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p101114"><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
</pre></td><td class="code" id="p101code114"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-latest.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&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: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&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>
      $<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;">&quot;resaltado&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <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>
      $<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;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;resaltado&quot;</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>
&nbsp;
  <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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  p <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> margin<span style="color: #339933;">:</span>5px<span style="color: #339933;">;</span> cursor<span style="color: #339933;">:</span>pointer<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  p.<span style="color: #660066;">resaltado</span> <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span> white<span style="color: #339933;">;</span> background<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>300px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Primer parrafo<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Segundo parrafo<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Tercer parrafo<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Más parrafos<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia4/ejemplo_click/index_click.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: dblclick()</h3>
<p>Este metodo ejecuta una funcion o script cuando se realiza doble clic sobre un elemento. En este ejemplo, el color de la capa cambiara con doble click.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code115'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p101115"><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
</pre></td><td class="code" id="p101code115"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-latest.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> divdbl <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div:first&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    divdbl.<span style="color: #660066;">dblclick</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> 
      divdbl.<span style="color: #660066;">toggleClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'dbl'</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>
&nbsp;
  <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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  div <span style="color: #009900;">&#123;</span> background<span style="color: #339933;">:</span>orange<span style="color: #339933;">;</span>
        color<span style="color: #339933;">:</span>white<span style="color: #339933;">;</span>
        height<span style="color: #339933;">:</span>100px<span style="color: #339933;">;</span>
        width<span style="color: #339933;">:</span>150px<span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
  div.<span style="color: #660066;">dbl</span> <span style="color: #009900;">&#123;</span> background<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> color<span style="color: #339933;">:</span>white<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;&lt;</span>span<span style="color: #339933;">&gt;</span>Haga doble clic en la capa<span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia4/ejemplo_dobleclick/index_dobleclick.htm">ver ejemplo</a></p>
<hr />
<h3>Evento: error() </h3>
<p>Este metodo permite ejecutar una funcion alternativa cuando ocurra un error en la ejecucion de la funcion principal.  En este ejemplo se realiza la carga de una imagen cuya ruta esta en el input, pero si no se encuentra la imagen devolvera un mensaje de error.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code116'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p101116"><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
</pre></td><td class="code" id="p101code116"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-latest.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
 <span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#show&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: #003366; font-weight: bold;">var</span> imgSrc <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;src&quot;</span><span style="color: #339933;">,</span> imgSrc<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;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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;">&quot;img&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">error</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: #000066; font-weight: bold;">this</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: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Imagen no encontrada&quot;</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;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <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>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text&quot;</span> size<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;100&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://static.jquery.com/files/design/images/logo_jquery3.png&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>button id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #339933;">&gt;</span>Ver imagen<span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;&lt;</span>img <span style="color: #339933;">/&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia4/ejemplo_error/index_error.htm">ver ejemplo</a></p>
<hr />
<p>En el siguiente post continuare culminare con el resto de eventos y comenzare con las formas de validacion.</p>
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=101</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dia 3 : Jquery en 7 dias para no iniciados [Manupulation_DOM][parte2]</title>
		<link>http://josesuarezcordova.com/?p=81</link>
		<comments>http://josesuarezcordova.com/?p=81#comments</comments>
		<pubDate>Thu, 30 Apr 2009 12:18:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[dom jquery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery basico]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[tutorial jquery]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=81</guid>
		<description><![CDATA[
publicidad


Buenas, amigos del Jquery, ahora continuaremos con el DOM manejado con Jquery, espero que hasta el momento tengais todo claro, sino dejar vuestro comentario y os respondere inmediatamente, bueno veremos otros metodos que tiene Jquery para manipular el DOM comenzare por:
after(content)
Este metodo como su nombre lo indica, insertara html despues del elementos que indiquemos en [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<div class="wp-caption aligncenter" style="width: 560px"><img alt="Publicidad" src="http://josesuarezcordova.com/images/banner_clases1.gif" title="Publicidad" width="550" height="64" /><p class="wp-caption-text">Publicidad</p></div>
<p>Buenas, amigos del Jquery, ahora continuaremos con el DOM manejado con Jquery, espero que hasta el momento tengais todo claro, sino dejar vuestro comentario y os respondere inmediatamente, bueno veremos otros metodos que tiene Jquery para manipular el DOM comenzare por:</p>
<h3>after(content)</h3>
<p>Este metodo como su nombre lo indica, insertara html despues del elementos que indiquemos en el script, como siempre he dicho siempre, hay que ver para creer y probar, asi que veamos un ejemplillo.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p81code125'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p81125"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p81code125"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;b&gt;Jquery&lt;/b&gt;&quot;</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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>span <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span> red<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>span<span style="color: #339933;">&gt;</span>Programando con <span style="color: #339933;">:</span> <span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia3/ejemplo_after/">ver ejemplo</a></p>
<h3>before(content)</h3>
<p>Este metodo permite insertar codigo HTML antes del elemento indicado en el script, veamos un ejemplo</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p81code126'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p81126"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p81code126"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">before</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;b&gt;Jquery &lt;/b&gt;&quot;</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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>span <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span> red<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>span<span style="color: #339933;">&gt;</span>Programando webs <span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia3/ejemplo_before/">ver ejemplo </a>
</p>
<hr />
<h3>wrap(html)</h3>
<p>Este metodo envuelva cada elemento correspondiente con su especificacion en HTML. Este proceso de wraping es de gran utilidad para la inyección adicional de otras marcas HTML en un documento, sin arruinar el codigo original. Veamos un ejemplo</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p81code127'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p81127"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p81code127"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">wrap</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div&gt;&lt;/div&gt;&quot;</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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  div <span style="color: #009900;">&#123;</span> border<span style="color: #339933;">:</span> 2px solid red<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>210px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  p <span style="color: #009900;">&#123;</span> background<span style="color: #339933;">:</span>yellow<span style="color: #339933;">;</span> margin<span style="color: #339933;">:</span>4px<span style="color: #339933;">;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Hola<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>amigos<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>del Jquery<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia3/ejemplo_wrap/">ver ejemplo</a>
</p>
<hr />
<h3>wrapAll(html)</h3>
<p>A diferencia de wrap(),  wrapAll() envuelva todos los elementos en uno solo. Este proceso no modifica el codigo original.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p81code128'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p81128"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p81code128"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">wrapAll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div&gt;&lt;/div&gt;&quot;</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>
  <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  div <span style="color: #009900;">&#123;</span> border<span style="color: #339933;">:</span> 2px solid red<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>210px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  p <span style="color: #009900;">&#123;</span> background<span style="color: #339933;">:</span>yellow<span style="color: #339933;">;</span> margin<span style="color: #339933;">:</span>4px<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Hola <span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>amigos<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>de Jquery<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia3/ejemplo_wrapAll/">ver ejemplo</a>
</p>
<hr />
<h3>remove()</h3>
<p>Este metodo elimina todos los elementos HTML establecidos en el script. veamos un comprensible ejemplo:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p81code129'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p81129"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p81code129"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;button&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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>p <span style="color: #009900;">&#123;</span> background<span style="color: #339933;">:</span>yellow<span style="color: #339933;">;</span> margin<span style="color: #339933;">:</span>6px <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>VBScript<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span> 
  Jquery
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>.<span style="color: #660066;">NET</span><span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>button<span style="color: #339933;">&gt;</span>Elimina lo que no sirve<span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia3/ejemplo_remove/">ver ejemplo</a>
</p>
<hr />
<h3>empty</h3>
<p>Este metodo elimina todo el HTML y texto que se encuentre contenido entre dichas marcas. Veamos un ejemplo</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p81code130'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p81130"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p81code130"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;button&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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  p <span style="color: #009900;">&#123;</span> background<span style="color: #339933;">:</span>yellow<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>
  Hola<span style="color: #339933;">,</span> <span style="color: #339933;">&lt;</span>b<span style="color: #339933;">&gt;</span>amigos de Jquery<span style="color: #339933;">&lt;/</span>b<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>button<span style="color: #339933;">&gt;</span>Pincha para eliminar<span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia3/ejemplo_empty/">ver ejemplo</a>
</p>
<hr />
<h3>replaceWith</h3>
<p>Este metodo reemplaza todos los elementos con el codigo HTML especificado en el script.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p81code131'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p81131"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code" id="p81code131"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;button&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: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replaceWith</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div&gt;&quot;</span> <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;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</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>
&nbsp;
  <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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  button <span style="color: #009900;">&#123;</span> display<span style="color: #339933;">:</span>block<span style="color: #339933;">;</span> margin<span style="color: #339933;">:</span>3px<span style="color: #339933;">;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
  div <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>red<span style="color: #339933;">;</span> border<span style="color: #339933;">:</span>2px solid blue<span style="color: #339933;">;</span> width<span style="color: #339933;">:</span>200px<span style="color: #339933;">;</span> 
        margin<span style="color: #339933;">:</span>3px<span style="color: #339933;">;</span> text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span>center<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>button<span style="color: #339933;">&gt;</span>JQuery<span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>button<span style="color: #339933;">&gt;</span>AJAX<span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>button<span style="color: #339933;">&gt;</span>Javascript<span style="color: #339933;">&lt;/</span>button<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia3/ejemplo_replaceWith/">ver ejemplo</a>
</p>
<hr />
<h3>clone(bool)</h3>
<p>Este metodo clona los elementos indicados en el script. Recibe un parametro booleano(true/false).</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p81code132'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p81132"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p81code132"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;button&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: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">clone</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">insertAfter</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: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <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>
&nbsp;
Pincha para clonar<span style="color: #339933;">:</span>
  <span style="color: #339933;">&lt;</span>button<span style="color: #339933;">&gt;</span>Jquery<span style="color: #339933;">!&lt;/</span>button<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia3/ejemplo_clone/">ver ejemplo</a>
</p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=81</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dia 2 : Jquery en 7 dias para no iniciados [Manupulation_DOM][parte1]</title>
		<link>http://josesuarezcordova.com/?p=55</link>
		<comments>http://josesuarezcordova.com/?p=55#comments</comments>
		<pubDate>Sun, 26 Apr 2009 19:12:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Varios]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[append]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[prepend]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=55</guid>
		<description><![CDATA[
publicidad


Buenas, amigos del Jquery, bien ahora veremos el manejo de DOM con Jquery, como sabeis El Document Object Model, cuya traduccion mas apropiada podría ser algo asi como Modelo en Objetos para la representación de Documentos, es basicamente una interfaz de programación de aplicaciones que proporciona un conjunto estándar de objetos para representar documentos HTML [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<p><img class="alignright" title="DOM" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7b/DocumentObjectModelES.svg/250px-DocumentObjectModelES.svg.png" alt="" width="250" height="333" />Buenas, amigos del Jquery, bien ahora veremos el manejo de DOM con Jquery, como sabeis El Document Object Model, cuya traduccion mas apropiada podría ser algo asi como Modelo en Objetos para la representación de Documentos, es basicamente una interfaz de programación de aplicaciones que proporciona un conjunto estándar de objetos para representar documentos HTML y XML, este estandar nos proporciona informacion sobre cómo pueden combinarse dichos objetos, y una interfaz estándar para acceder a ellos y manipularlos.</p>
<p>Utilizando adecuadamente el  DOM, los programadores podemos  acceder y modificar el contenido, estructura y estilo de los documentos HTML y XML.</p>
<p>El responsable del DOM es el consorcio <a href="http://es.wikipedia.org/wiki/W3C" onclick="pageTracker._trackPageview('/outgoing/es.wikipedia.org/wiki/W3C?referer=');">W3C </a>(World Wide Web Consortium).</p>
<p>En efecto, el DOM es una <a href="http://es.wikipedia.org/wiki/Interfaz_de_programaci%C3%B3n_de_aplicaciones" onclick="pageTracker._trackPageview('/outgoing/es.wikipedia.org/wiki/Interfaz_de_programaci_C3_B3n_de_aplicaciones?referer=');">API</a> para acceder, añadir y cambiar dinámicamente contenido estructurado en documentos con lenguajes como <a href="http://es.wikipedia.org/wiki/ECMAScript" onclick="pageTracker._trackPageview('/outgoing/es.wikipedia.org/wiki/ECMAScript?referer=');">ECMAScript (Javascript)</a>.</p>
<h3>El metodo ready</h3>
<p>El primer paso es crear una función anónima dentro del archivo para abarcar todos los javascript.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p55code139'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p55139"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p55code139"><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: #006600; font-style: italic;">// code here</span>
 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Esta es una tecnica apropiada para poder trabajar con todos los scripts que utilicemos en el documento, no sera necesario crear funciones con nombre, pues utilizaremos referencias al DOM para activar las funciones, esta es una importante diferencia con el tradicional Javascript y hace de Jquery mas eficiente.</p>
<div class="wp-caption aligncenter" style="width: 560px"><img alt="Publicidad" src="http://josesuarezcordova.com/images/banner_clases1.gif" title="Publicidad" width="550" height="64" /><p class="wp-caption-text">Publicidad</p></div>
<h3>html( val )</h3>
<p>Configura el HTML que insertareis en un elemento determinado. Esta propiedad no está disponible en los documentos XML (a pesar de que trabajará para los documentos XHTML).</p>
<p>Ejemplo:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p55code140'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p55140"><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
</pre></td><td class="code" id="p55code140"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;span class='miclase1'&gt;Hola Amigos del Jquery  &lt;/span&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Con el tipo de elemento</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#micapa&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;span class='miclase2'&gt;como mola Jquery, a que si!  &lt;/span&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Con la ID del elemento</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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
.<span style="color: #660066;">miclase1</span><span style="color: #009900;">&#123;</span>
	font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>20px<span style="color: #339933;">;</span>
	color<span style="color: #339933;">:</span>#ff5500<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
.<span style="color: #660066;">miclase2</span><span style="color: #009900;">&#123;</span>
	font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>25px<span style="color: #339933;">;</span>
	color<span style="color: #339933;">:</span>#005500<span style="color: #339933;">;</span>
	border<span style="color: #339933;">:</span> 1px solid<span style="color: #339933;">;</span>
	margin<span style="color: #339933;">-</span>top<span style="color: #339933;">:</span>10px<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;micapa&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Como veis, en este ejemplo estoy introduciendo codigo HTML desde  el script, en dos elementos aparentemente iguales, dos capas, para una utilizo el nombre del elemento</p>
<div> y para la segunda utilizo el id del elemento &#8221; div id=&#8221; &#8221; , en el body no tendreis que insertar nada, solo indicar el id adecuado si asi lo hicieseis en el codigo o ubicar la capa donde querais, sin ninguna id necesaria.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia2/ejemplo_HTML/">ver ejemplo</a></p>
<hr />
<h3>text()</h3>
<p>Esta funcion permite mostrar en texto plano el contenido para  un determinado elemento, por ejemplo una capa o un parrafo, se utiliza por lo  general para mostrar codigo HTML tal cual.</p>
<p>ejemplo:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p55code141'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p55141"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p55code141"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&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;
&lt;div&gt;&lt;b&gt;HTML&lt;/b&gt; puro y duro.&lt;/div&gt;
&nbsp;
&quot;</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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
  p <span style="color: #009900;">&#123;</span> color<span style="color: #339933;">:</span>blue<span style="color: #339933;">;</span> margin<span style="color: #339933;">:</span>8px<span style="color: #339933;">;</span> font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>30px<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Como vereis, a pesar de dar estilo al &#8220;p&#8221; este formatea solo el contenido que lo sigue mostrando como HTML por la funcion .text</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia2/ejemplo_text/">ver el ejemplo</a></p>
<p>¿A que es muy facil? bueno ya que estamos puestos, sigamos no?.</p>
<p>Que pasa si , por ejemplo, queremos agregar a un elemento algun estilo en caliente, al que ya tiene establecido un estilo por una hoja  css, en ese caso utilizaremos el siguiente metodo.</p>
<h3>append(content)</h3>
<p>Esta operación es similar a hacer una appendChild a todos los elementos especificados, agregados en el documento. Con este metodo agregamos por ejemplos, estilos a una etiqueta ya formateada.</p>
<p>Este ejemplo nos grafica claramente su uso.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p55code142'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p55142"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p55code142"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;strong&gt;Jquery&lt;/strong&gt;&quot;</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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>p <span style="color: #009900;">&#123;</span> width<span style="color: #339933;">:</span>250px<span style="color: #339933;">;</span> font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>20px<span style="color: #339933;">;</span> background<span style="color: #339933;">:</span>gray<span style="color: #339933;">;</span>  <span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
Hola amigos del</pre></td></tr></table></div>

<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia2/ejemplo_append/ejemplo_append.htm">vea el ejemplo</a></p>
<hr />
<p>Veamos otro ejemplo agregando un nodo de texto a nuestro parrafo.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p55code143'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p55143"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p55code143"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Jquery&quot;</span><span style="color: #009900;">&#41;</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>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>p <span style="color: #009900;">&#123;</span> width<span style="color: #339933;">:</span>350px<span style="color: #339933;">;</span> font<span style="color: #339933;">-</span>size<span style="color: #339933;">:</span>20px<span style="color: #339933;">;</span> background<span style="color: #339933;">:</span>gray<span style="color: #339933;">;</span>  <span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
&nbsp;
Hola otra vez amigos del</pre></td></tr></table></div>

<p>En este ejemplo estamos agregando por DOM un nodo de texto con esta linea document.createTextNode() , mediante el metodo append.</p>
<p style="font-size:18px;"><a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia2/ejemplo_append/ejemplo_append2.htm">ver ejemplo</a></p>
<hr />
<h3>prepend(content)</h3>
<p>Esta operación es la mejor manera de insertar al principio, codigo dentro de otros elementos. Como si se tratase de un prefijo para parrafos u oraciones.</p>
<p>ejemplo</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p55code144'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p55144"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p55code144"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">prepend</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;b&gt;JQuery &lt;/b&gt;&quot;</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>
  <span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>p <span style="color: #009900;">&#123;</span> background<span style="color: #339933;">:</span>gray<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>es lo mas<span style="color: #339933;">!&lt;/</span>p<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>es javascript al maximo<span style="color: #339933;">!&lt;/</span>p<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>es <span style="color: #003366; font-weight: bold;">super</span> chachi<span style="color: #339933;">!&lt;/</span>p<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>es la ost.....<span style="color: #339933;">!&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Como veis en el script definimos ese &#8220;prefijo&#8221; que se insertara en al inicio de las cadenas que esten entre las marcas definidas.</p>
<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia2/ejemplo_prepend/ejemplo_prepend.htm">ver ejemplo </a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=55</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dia 1 : Jquery en 7 dias para no iniciados [introduccion] [instalacion]</title>
		<link>http://josesuarezcordova.com/?p=16</link>
		<comments>http://josesuarezcordova.com/?p=16#comments</comments>
		<pubDate>Fri, 24 Apr 2009 10:49:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[diseño]]></category>
		<category><![CDATA[jquery introducción]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[programacion]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://josesuarezcordova.com/?p=16</guid>
		<description><![CDATA[
publicidad


Presentación
Esta es la introducción de una serie de 7 post/dia donde presentare las principales caracteristicas y alcances de esta genial y potente libreria que dia a dia va creando mas &#8220;amigos del Jquery&#8221; y tambien veremos algunos de sus mas importantes plugins, pero como el objetivo principal de este tutorial es conocer Jquery puro y duro, el [...]]]></description>
			<content:encoded><![CDATA[<fieldset>
<legend>publicidad</legend>
<p><script language="JavaScript" src="http://pf.tradedoubler.com/pf/pf?a=1714900&#038;categoryId=589&#038;recurse=true&#038;exclProductIds=93375177&#038;xslUrl=http://img.tradedoubler.com/images/xsl/xsl16.xsl&#038;xslParamName1=page&#038;xslParamValue1=0&#038;xslParamName2=pageSize&#038;xslParamValue2=9&#038;maxResults=3&#038;oe=UTF-8&#038;js=true" charset="UTF-8"></script><br />
</fieldset>
<h3>Presentación</h3>
<p>Esta es la introducción de una serie de 7 post/dia donde presentare las principales caracteristicas y alcances de esta genial y potente libreria que dia a dia va creando mas <em><strong>&#8220;amigos del Jquery&#8221;</strong></em> y tambien veremos algunos de sus mas importantes plugins, pero como el objetivo principal de este tutorial es conocer Jquery puro y duro, el uso de plugins se reservaran para el final, primero aprendamos a caminar con buen paso.</p>
<h3>Introducción</h3>
<p>Jquery es una librería de Javascript, creada por John Resig en el  2006, en la actualidad se ha convertido en una (sino en la unica) de las librerias mas utilizada por desarrolladores y diseñadores Web, y ha conseguido algo que muchos otras librerias han tenido como objetivo, integrar la creatividad y la interaccion con los usuarios  sin menorizar nigun lado, creando aplicaciones Web crossbrowser muy potentes que interactuan con el Servidor sin sobrecargar la transferencia de datos y creando una interfaz amigable e intuitiva para los usuarios finales.</p>
<p>Como desarrollador con mas de 10 años en el negocio, he visto evolucionar la Web de una manera vertiginosa y desordenada, limitando a los programadores y diseñadores a realizar sus tareas sin ver mas halla,  con muchas teorias y tendencias que les guiaban hacia lados opuestos y cada quien tirando para su lado, pero ultimamente han ido surgiendo distintos lenguajes y frameworks que rompen esas paredes entre estas areas, para poder integrar sus trabajos sin mayor inversion en tiempo, esfuerzo y dinero. Desde que viera la luz el HTML y su compañero de siempre Javascript, desde el reinado de los alerts, popUps, DHTML  y demas criaturas de la Web, han pasado muchas lineas de codigo que van refinando esos pergaminos que eran las Webs hasta hace unos años, hasta convertirse en verdaderas modelos de certamenes de belleza en que se estan convirtiendo hoy por hoy,  no solo reduciendo las lineas de programacion sino optimizando su funcionalidad y creando un ambiente amigable e intuitivo para los usuarios, que cada vez son mas exigentes y piden mas interaccion, ya no son los tipicos usuarios que daban clic y leian lo que algun webmaster hiba publicando, ahora quieren participar en el crecimiento del Site, es por eso que ante tanta exigencia del usuario final, los lenguajes de programacion web han ido evolucionando hacia la integracion del diseño y la programacion, para crear un entorno usable y optimizado para todos.</p>
<p>A pocos clics de la Web 3.0, podeis empezar a recorrer este camino en el punto en que os encontreis y este pequeño aporte intenta daros una base para que ese camino sea creativo y desarrollado. Bueno pero como este no es un post de &#8220;historia Web&#8221; comenzare con el tema.</p>
<h3>Características de jQuery</h3>
<p>Estas son las principales caracteristicas de esta libreria.</p>
<ul>
<li>Interactuar con el DOM usando funciones</li>
<li>DOM transversal</li>
<li>Manejo de Eventos</li>
<li>Manipulación del CSS</li>
<li>Efectos y animaciones</li>
<li>Ajax</li>
<li>Extensibilidad</li>
<li>Utilidades &#8211; como la versión del navegador y la función de cada uno</li>
<li>JavaScript Plugins</li>
</ul>
<h3>Instalando Jquery</h3>
<p>Jquery no hay que instalarlo propiamente dicho como se habia hecho antes con otros programas, ya que no es un &#8220;programa residente en su ordenador&#8221; es una libreria, un archivo &#8220;,js&#8221; que debera estar en una carpeta de su Sitio Web,  seria recomendable que la pongais en una subcarpeta de nombre  &#8221;js&#8221; dentro de la carpeta de presentacion (si no conoceis la arquitectura MVC, no pasa nada), me refiero a una carpeta donde tengais todo el contenido estatico y paginas de presentacion al cliente.</p>
<p>Entonces procedemos a descargar la libreria del sitio oficial claro, este es <a href="http://jquery.com/" onclick="pageTracker._trackPageview('/outgoing/jquery.com/?referer=');">http://jquery.com/</a> o directamente en este link  <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.js" target="_blank" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.js&amp;referer=');">jquery-1.3.2.js</a> , cuando escribi este post la version era la 1.3.2, pero si quereis saber cual es la version actual o el historial de versiones publicadas visitar <a href="http://code.google.com/p/jqueryjs/downloads/list" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/jqueryjs/downloads/list?referer=');">http://code.google.com/p/jqueryjs/downloads/list</a> os recomiendo que para vuestros ejemplos locales useis la version descomprimida (Uncompressed) pero al publicar utilizar la version minima (Minified).</p>
<p>Una vez hecho esto lo que se viene es un paseo por el parque&#8230;  hasta el siguiente post.</p>
<h3>Primer Ejemplo</h3>
<p>Una vez hecho esto, procedemos a crear un primer ejemplo que nos permita dar uso a Jquery, veamos este ejemplo como la forma de uso de Jquery y su funcionalidad mas que por los detalles, pues sera un tema de un post posterior. En este ejemplo cargaremos una pagina HTML en un &lt;div&gt; y esto podria resolveros muchos casos.  Este fichero podreis llamarlo ejemplo1.htm<br />
 <!-- CODIGO --></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p16code150'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16150"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p16code150"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> mostrarContent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		$.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			url <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;pagina.htm&quot;</span><span style="color: #339933;">,</span>
			success <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#contentDiv&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>data<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: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Aunque es un poco cutre poner el CSS en un Style, nos daremos la licencia solo por hoy, pero en lo futuro usareis como es debido un fichero .css para crear el estilo. Ahora creamos el archivo HTML  pagina.htm</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p16code151'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16151"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p16code151"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>h2<span style="color: #339933;">&gt;</span>Hola amigos del Jquery<span style="color: #339933;">!!&lt;/</span>h2<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Listo ahora podeis cargar la pagina en el navegador y vereis el sieguiente resultado </p>
<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia1/Ejemplo1Jquery_cargarPagina/">ver ejemplo</a>
</p>
<hr />
<h3>Segundo Ejemplo</h3>
<p>Veamos otro ejemplo sencillo para comprobar la potencia y facilidad con que Jquery realiza efectos utiles.</p>
<p>Este ejemplo mostrara una capa y la ocultara con un boton que puede ser una imagen o un hipervinculo.</p>
<p>Primero creamos la pagina</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p16code152'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16152"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p16code152"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>				   
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.panel .delete&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: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parents</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.panel&quot;</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> opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">'hide'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</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>
&nbsp;
<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>Con Jquery podemos acceder a los distintos elementos del documento esto es el DOM, y utilizar metodos para crear animaciones con estos elementos, la forma de referenciar a estos elementos es mediante la ID o el nombre de la Clase. Ademas podemos usar en una funcion a mas de un elemento del DOM.</p>
<p>Luego crearemos un estilo para darle mayor vistocidad al ejemplo</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p16code153'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16153"><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
</pre></td><td class="code" id="p16code153"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span><span style="color: #339933;">&gt;</span>
body <span style="color: #009900;">&#123;</span>
	margin<span style="color: #339933;">:</span> 10px auto<span style="color: #339933;">;</span>
	width<span style="color: #339933;">:</span> 470px<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
h3 <span style="color: #009900;">&#123;</span>
	margin<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
	padding<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span> <span style="color: #CC0000;">0</span> .3em<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
p <span style="color: #009900;">&#123;</span>
	margin<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
	padding<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span> <span style="color: #CC0000;">0</span> .5em<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
.<span style="color: #660066;">panel</span> <span style="color: #009900;">&#123;</span>
	background<span style="color: #339933;">:</span> #edf5e1<span style="color: #339933;">;</span>
	padding<span style="color: #339933;">:</span> 10px 20px 10px<span style="color: #339933;">;</span>
	position<span style="color: #339933;">:</span> relative<span style="color: #339933;">;</span>
	border<span style="color: #339933;">-</span>top<span style="color: #339933;">:</span> solid 2px #c4df9b<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
.<span style="color: #660066;">panel</span> .<span style="color: #000066; font-weight: bold;">delete</span> <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	top<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
	right<span style="color: #339933;">:</span> 10px<span style="color: #339933;">;</span>
	cursor<span style="color: #339933;">:</span> pointer<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Como ya les comente, los detalles de estos metodos los ampliaremos posteriormente, solo quiero que se vayan familiarizando con el codigo.</p>
<p>Por ultimo creamos el cuerpo de la pagina</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p16code154'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox" style="width:100%; border:1px solid gray; overflow:scroll;"><table width="100%" ><tr id="p16154"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p16code154"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;panel&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Cabecera<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>Este es otro ejemplo de funcionalidad de Jquery<span style="color: #339933;">,</span> como veis es muy sencillo de aplicar y los efectos son muy utiles.<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;images/delete.png&quot;</span> width<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;32&quot;</span> height<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;32&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;delete&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;delete&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Como vereis utilizo una capa que sera la afectada por el ejemplo y la que tiene la clase &#8220;panel&#8221; asi como el boton con la clase &#8220;delete&#8221; ambos elementos seran utilizados en la misma funcion de Jquery.</p>
<p style="font-size:18px;">
<a href="http://josesuarezcordova.com/ejemplosJquery/tutorial7dias/dia1/Ejemplo2Jquery_ocultarCapa/">ver ejemplo</a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://josesuarezcordova.com/?feed=rss2&amp;p=16</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
