<?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>Mas que Wordpress - Tutoriales, recursos web, JQuery y PHP, Wordpress , twitter y muchos recursos más &#187; jquery.plugin</title>
	<atom:link href="http://www.masquewordpress.com/tag/jquery-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.masquewordpress.com</link>
	<description>Tutoriales y recursos web sobre JQuery , PHP, Wordpress , twitter. Aprende diseño web y programación</description>
	<lastBuildDate>Mon, 06 Feb 2012 15:02:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Plugin jQuery para limitar caracteres en un campo de texto</title>
		<link>http://www.masquewordpress.com/plugin-jquery-para-limitar-caracteres-en-un-campo-de-texto/</link>
		<comments>http://www.masquewordpress.com/plugin-jquery-para-limitar-caracteres-en-un-campo-de-texto/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 15:36:02 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[jquery.plugin]]></category>
		<category><![CDATA[tutorial jquery]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=811</guid>
		<description><![CDATA[[offtopic] Antes de empezar este artículo quiero dar mis condolencias a la Familia Jobs. Para mi Steve Jobs siempre fue un grande , incluso antes de enamorarme de sus productos y SO. Siempre recomiendo ver un discurso dado por el para los alumnos de Standford Bridge. Lo pueden encontrar en http://www.youtube.com/watch?feature=player_embedded&#38;v=14v3kV47oZU [/offtopic] Hoy les voy [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>[offtopic] Antes de empezar este artículo quiero dar mis condolencias a la Familia Jobs. Para mi Steve Jobs siempre fue un grande , incluso antes de enamorarme de sus productos y SO. Siempre recomiendo ver un discurso dado por el para los alumnos de Standford Bridge. Lo pueden encontrar en http://www.youtube.com/watch?feature=player_embedded&amp;v=14v3kV47oZU [/offtopic]</p></blockquote>
<p>Hoy les voy a enseñar 2 cosas. <strong>Como limitar los caracteres de un campo de texto ya sea un textarea o un input</strong> y <strong>como crear un plugin de Jquery</strong>.<br />
<span id="more-811"></span><br />
Lo primero que necesitamos en un nuevo formulario dentro de una <strong>página HTML</strong> y le vamos a agregar un <strong>etiqueta span</strong> que será donde mostremos los caracteres que nos quedan con <strong>id=&#8221;counter&#8221;</strong>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE  HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;  &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
   &lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/jsapi&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;script  type=&quot;text/javascript&quot;&gt;
        $(document).ready(function() {
        //Nuestras funciones jQuery
        });
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form  id=&quot;formulario&quot;  method=&quot;POST&quot; action=&quot;?&quot;&gt;
    &lt;textarea  id=&quot;text&quot;&gt;&lt;/textarea&gt;
    &lt;span  id=&quot;counter&quot;&gt;&lt;/span&gt;
    &lt;input type=&quot;submit&quot;  value=&quot;submit&quot;&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>Ahora escribamos nuestra función para mostrar cuantos caracteres nos quedan.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> caracteres<span style="color: #339933;">=</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#counter&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;Te quedan &lt;strong&gt;&quot;</span><span style="color: #339933;">+</span> caracteres<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/strong&gt; caracteres&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Creamos una función que en el evento keyup que compruebe que la cantidad de caracteres escritos no es mayor que el limite que establecimos anteriormente. En caso contrario borra el valor de campo que excede dicho limite:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#text&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><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>$<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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> caracteres<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;">val</span><span style="color: #009900;">&#40;</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> caracteres<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Explicando un poco esta función vemos que cada vez que se levanta el dedo de un tecla <strong>obtenemos el length(cantidad)</strong> de caracteres del <strong>valor(val)</strong> de nuestro campo de texto y lo comparamos con la cantidad estipulada anteriormente.<br />
Si es mayor el valor del campo es sustituido por el valor actual menos el limite estipulado. Es decir, con la <strong>función substr</strong> recortamos la cadena de texto desde el caracter 0 hasta 100 y el resultado sustituye el valor del campo de texto.</p>
<p>Ahora cambiemos la frase de nuestro counter.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span>  quedan <span style="color: #339933;">=</span> caracteres <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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#counter&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;Te quedan &lt;strong&gt;&quot;</span><span style="color: #339933;">+</span> quedan<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/strong&gt; caracteres.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Aquí solamente restamos el limite establecido menos la cantidad de caracteres de nuestro campo.</p>
<p>Y si queremos agregarle un toque de color podemos hacer lo siguiente:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>quedan <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#counter&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;color&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;red&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">else</span>
<span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#counter&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;color&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;black&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Si nos quedan menos de diez caracteres , nuestro mensaje se volvera rojo!</p>
<p>El script entero entonces queda de la siguiente forma:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> caracteres <span style="color: #339933;">=</span> <span style="color: #CC0000;">220</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#counter&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;Te quedan &lt;strong&gt;&quot;</span><span style="color: #339933;">+</span>  caracteres<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/strong&gt; caracteres.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;">keyup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> caracteres<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;">val</span><span style="color: #009900;">&#40;</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> caracteres<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: #003366; font-weight: bold;">var</span> quedan <span style="color: #339933;">=</span> caracteres <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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#counter&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;Te quedan &lt;strong&gt;&quot;</span><span style="color: #339933;">+</span>  quedan<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/strong&gt; caracteres.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>quedan <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#counter&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;color&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;red&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">else</span>
    <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#counter&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;color&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;black&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Pueden ver el ejemplo funcionando en <a href="http://jsfiddle.net/sa4HH/">http://jsfiddle.net/sa4HH/</a></strong></p>
<h3>Crear un Plugin jQuery para delimitar los campos de texto</h3>
<p>Por lo general vamos a necesitar este código en más de una ocasión y para varios campos de texto, por lo que repetir todo una y otra vez no es aceptable. En este caso nos conviene crear un simple plugin de jQuery que será facil de aplicar.<br />
Para ello siguiendo la lógica de jQuery vamos a crear la base de nuestro plugin que lo vamos a llamar <strong>&#8220;limitar&#8221;</strong>:<br />
¡</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><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: #660066;">fn</span>.<span style="color: #660066;">limitar</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      defaults <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
        limite<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">,</span>
        id_counter<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        clase_alert<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span>
     <span style="color: #009900;">&#125;</span>
   <span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>defaults<span style="color: #339933;">,</span>  options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Al declarar nuestro <strong>plugin limitar</strong> hemos creado unos valores por defecto que paso a explicar.</p>
<ul>
<li><strong>limite</strong>: Es el límite por defecto. En este caso <strong>200</strong> caracteres.</li>
<li><strong>id_counter</strong>: Es el id del campo donde mostraremos el mensaje de caracteres faltantes. Por defecto es <strong>false</strong>, por lo que no mostraríamos ningún mensaje.</li>
<li><strong>clase_alert</strong>: En lugar de cambiar el color si los caracteres son menos que diez vamos a asignarle un clase para así dar más libertad a la hora de aplicar estilo a este mensaje de alerta. Por defecto no se asigna ninguna clase ya que es <strong>false</strong>.</li>
</ul>
<p>Ahora debemos terminar la función de nuestro plugin:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> caracteres <span style="color: #339933;">=</span> options.<span style="color: #660066;">limite</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">id_counter</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>options.<span style="color: #660066;">id_counter</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Te quedan &lt;strong&gt;&quot;</span><span style="color: #339933;">+</span> caracteres <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/strong&gt; caracteres.&quot;</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><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>$<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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> caracteres<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;">val</span><span style="color: #009900;">&#40;</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> caracteres<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;">if</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">id_counter</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> quedan <span style="color: #339933;">=</span>  caracteres <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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>options.<span style="color: #660066;">id_counter</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Te quedan &lt;strong&gt;&quot;</span><span style="color: #339933;">+</span> quedan <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/strong&gt; caracteres&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>quedan <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>options.<span style="color: #660066;">id_counter</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">clase_alert</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000066; font-weight: bold;">else</span>
            <span style="color: #009900;">&#123;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>options.<span style="color: #660066;">id_counter</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">clase_alert</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Estamos replicando nuestra función del principio con la única diferencia que usamos los valores dentro del array <strong>options</strong> para dar más flexibilidad al código y miren que sin por ejemplo <strong>options.id_counter es false</strong> nunca mostraremos el mensaje.</p>
<p>El plugin entero que debemos guardar como jquery.limitar.js quedaría de la siguiente forma:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><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: #660066;">fn</span>.<span style="color: #660066;">limitar</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      defaults <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
        limite<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">,</span>
        id_counter<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        clase_alert<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span>
     <span style="color: #009900;">&#125;</span>
   <span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>defaults<span style="color: #339933;">,</span>  options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> caracteres <span style="color: #339933;">=</span> options.<span style="color: #660066;">limite</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">id_counter</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>options.<span style="color: #660066;">id_counter</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Te quedan &lt;strong&gt;&quot;</span><span style="color: #339933;">+</span> caracteres <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/strong&gt; caracteres.&quot;</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><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>$<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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> caracteres<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;">val</span><span style="color: #009900;">&#40;</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> caracteres<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;">if</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">id_counter</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> quedan <span style="color: #339933;">=</span>  caracteres <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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>options.<span style="color: #660066;">id_counter</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Te quedan &lt;strong&gt;&quot;</span><span style="color: #339933;">+</span> quedan <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/strong&gt; caracteres&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>quedan <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>options.<span style="color: #660066;">id_counter</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">clase_alert</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000066; font-weight: bold;">else</span>
            <span style="color: #009900;">&#123;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>options.<span style="color: #660066;">id_counter</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">clase_alert</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Para usarlo tan solo debemos llamarlo de la siguiente manera (no se olviden de crear la clase para dar estilo al mensaje de alerta):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script  type=&quot;text/javascript&quot; src=&quot;jquery.limit.js&quot;&gt;&lt;/script&gt;
&lt;style&gt;
.alert{
    color: red;
    font-weight:bold;
}
&lt;/style&gt;
&lt;script  type=&quot;text/javascript&quot;&gt;
    $(document).ready(function() {
        $(&quot;#testo&quot;).limitar({
            limite: 100,
            id_counter: &quot;counter&quot;,
            clase_alert: &quot;alert&quot;
            });
         });
&lt;/script&gt;</pre></td></tr></table></div>

<p>Pueden ver el ejemplo funcionando en <a href="http://jsfiddle.net/V7Gs6/1/">http://jsfiddle.net/V7Gs6/1/</a></p>
<p>Saludos!!!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/plugin-jquery-para-limitar-caracteres-en-un-campo-de-texto/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Introducción  a JQuery Template plugin jquery.tmpl.js</title>
		<link>http://www.masquewordpress.com/introduccion-a-jquery-template-plugin-jquery-tmpl-js/</link>
		<comments>http://www.masquewordpress.com/introduccion-a-jquery-template-plugin-jquery-tmpl-js/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 22:28:52 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[jquery.plugin]]></category>
		<category><![CDATA[jquery.tmpl.js]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=667</guid>
		<description><![CDATA[Hace poco el equipo de JQuery anuncio que el  plugin de templates de Microsoft es ahora soportado oficialmente. Esto quiere decir que el propio equipo de JQuery se va a encargar de su desarollo y actualizaciones. A continuación les explico como integrarlo y usarlo de una forma sencilla. Para este ejemplo vamos a utilizar mis [...]]]></description>
			<content:encoded><![CDATA[<p>Hace poco el equipo de JQuery <a href="http://api.jquery.com/category/plugins/templates/">anuncio</a> que el  <a href="http://github.com/jquery/jquery-tmpl">plugin de templates</a> de Microsoft es ahora soportado oficialmente. Esto quiere decir que el propio equipo de JQuery se va a encargar de su desarollo y actualizaciones. A continuación les explico como integrarlo y usarlo de una forma sencilla.</p>
<p><span id="more-667"></span></p>
<div id="ejemplo">
<div class="wrap-ej"><a href="http://masquewordpress.com/ejemplos/jquery-templates.zip" class="descarga"></a><a href="http://masquewordpress.com/ejemplos/jquery-templates/" class="demo"></a></div>
</div>
<p>Para este ejemplo vamos a utilizar <a href="http://masquewordpress.com/tag/twitter">mis últimos tweets en Twitter</a> de manera que sirvan para rellenar el template que vamos a crear previamente.</p>
<h3>1. El primer paso es <a href="http://masquewordpress.com/recursos/como-mejorar-velocidad-carga-pagina-web/">integrar JQuery</a> y el plugin de templates</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>  
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.tmpl.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<h3>2. Creamos el template</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tweets&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/x-jquery-tmpl&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${imgSource}&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${username}&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span> ${username} <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span> ${tweet} <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
		{{if geo}}
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;</span> ${geo} <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
		{{/if}}
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>Cabe destacar que:</p>
<ul>
<li>Nuestro template se encuentra dentro de las tags <strong>&lt;script&gt;</strong> y el type usado es <strong>text/x-jquery-tmpl</strong></li>
<li>Las variables tienen el siguiente formato <strong>${</strong>nombreDeVariable<strong><span><span>}</span></span></strong></li>
<li><span><span>Se pueden crear <strong>sentencias if</strong> de la siguiente manera</span></span><strong><span><span> {{if </span></span></strong><span><span>condicion</span></span><strong><span><span>}</span></span></strong><strong><span><span>}</span></span></strong><strong><span><span> </span></span></strong><span><span>sentencia a ejecutar</span></span><strong><span><span> {{/if</span></span></strong><strong><span><span>}</span></span></strong><strong><span><span>}</span></span></strong></li>
</ul>
<h3>3. Buscamos algun dato para renderizar en nuestro template</h3>
<p>En este caso usando la SEARCH API de Twitter obtenemos los últimos resultados donde mencionan <a href="http://twitter.com/chifliiiii">mi cuenta de twitter</a>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
 $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    type <span style="color: #339933;">:</span> <span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span>
    dataType <span style="color: #339933;">:</span> <span style="color: #3366CC;">'jsonp'</span><span style="color: #339933;">,</span>
    url <span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://search.twitter.com/search.json?q=chifliiiii'</span><span style="color: #339933;">,</span>
&nbsp;
    success <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>tweets<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #003366; font-weight: bold;">var</span> twitter <span style="color: #339933;">=</span> $.<span style="color: #660066;">map</span><span style="color: #009900;">&#40;</span>tweets.<span style="color: #660066;">results</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> index<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
             username <span style="color: #339933;">:</span> obj.<span style="color: #660066;">from_user</span><span style="color: #339933;">,</span>
             tweet <span style="color: #339933;">:</span> obj.<span style="color: #660066;">text</span><span style="color: #339933;">,</span>
             imgSource <span style="color: #339933;">:</span> obj.<span style="color: #660066;">profile_image_url</span><span style="color: #339933;">,</span>
             geo <span style="color: #339933;">:</span> obj.<span style="color: #660066;">geo</span>
          <span style="color: #009900;">&#125;</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;">&#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></pre></td></tr></table></div>

<p>Como veran usamos las variables definidas en el paso anterior para almacenar los varoles devueltos.</p>
<h3>4. Creamos el espacio donde actuara nuestra template</h3>
<p>Si recuerdan nuestra template no era más que un elemento <strong>&lt;li&gt;</strong> de una lista desordenada. Por lo que debemos crear dicha lista.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tweets&quot;</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></td></tr></table></div>

<h3>5. Enlazamos los datos al template y lo introducimos a la lista</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweets'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tmpl</span><span style="color: #009900;">&#40;</span>twitter<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#twitter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<ul>
<li>Seleccionamos el script (template) con id = tweets </li>
<li> Le pasamos el array twitter creado con .map al template </li>
<li> Añadimos lo anterior a la lista con id twitter</li>
</ul>
<p>Y con eso ya estaría todo en su sitio de manera que todo junto quedaría de la siguiente forma:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE HTML&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> <span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;en&quot;</span>&gt;</span>
   <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">charset</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;UTF-8&quot;</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;style.css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
&nbsp;
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.tmpl.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
   <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
   <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
&nbsp;
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span> Algunos tweets de mi cuenta <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>
&nbsp;
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tweets&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/x-jquery-tmpl&quot;</span>&gt;</span>
         <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${imgSource}&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${userName}&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span> ${username} <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span> ${tweet} <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
            {{if geo}}
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
               ${geo}
            <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
            {{/if}}
         <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
&nbsp;
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;twitter&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
&nbsp;
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
         $.ajax({
            type : 'GET',
            dataType : 'jsonp',
            url : 'http://search.twitter.com/search.json?q=chifliiiii',
&nbsp;
            success : function(tweets) {
               var twitter = $.map(tweets.results, function(obj, index) {
                  return {
                     username : obj.from_user,
                     tweet : obj.text,
                     imgSource : obj.profile_image_url,
                     geo : obj.geo
                  };
               });
&nbsp;
               $('#tweets').tmpl(twitter).appendTo('#twitter');
            }
      });
&nbsp;
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
   <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Un saludo y hasta la proxima!!!</p>
<div id="ejemplo">
<div class="wrap-ej"><a href="http://masquewordpress.com/ejemplos/jquery-templates.zip" class="descarga"></a><a href="http://masquewordpress.com/ejemplos/jquery-templates/" class="demo"></a></div>
</div>
<p>Via | <a href="http://net.tutsplus.com/">Nettuts+</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/introduccion-a-jquery-template-plugin-jquery-tmpl-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Estadísticas del blog &#8211; Septiembre 2010</title>
		<link>http://www.masquewordpress.com/estadisticas-del-blog-septiembre-2010/</link>
		<comments>http://www.masquewordpress.com/estadisticas-del-blog-septiembre-2010/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 00:52:04 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Noticias]]></category>
		<category><![CDATA[estadisticas]]></category>
		<category><![CDATA[jquery.plugin]]></category>
		<category><![CDATA[plugins wordpress]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=647</guid>
		<description><![CDATA[Es la primera vez que comparto la estadísticas del blog con ustedes. La verdad que nunca antes me dio por hacerlo ya que no eran gran cosa. A día de hoy aunque no tiene ni comparación con otras webs la cifra ya me hace sentir un poco de algo llamado orgullo, y como este sentimiento [...]]]></description>
			<content:encoded><![CDATA[<p>Es la primera vez que comparto la estadísticas del blog con ustedes. La verdad que nunca antes me dio por hacerlo ya que no eran gran cosa.<br />
A día de hoy aunque no tiene ni comparación con otras webs la cifra ya me hace sentir un poco de algo llamado orgullo, y como este sentimiento es gracias a todos ustedes ( si, vos que estas leyendo esto) me pareció sensato publicar las estadísticas y de paso aprovechar para dar las gracias a ese porcentaje de gente que sigue viniendo de vez en cuando a ver si encuentra algo interesante. Dicho lo dicho una vez más <strong>te doy las gracias</strong> y pasemos a los números:<br />
<span id="more-647"></span><br />
<a href="http://masquewordpress.com/wp-content/uploads/2010/09/stats-septiembre-2010.gif"><img class="aligncenter size-full wp-image-648" title="stats-septiembre-2010" src="http://masquewordpress.com/wp-content/uploads/2010/09/stats-septiembre-2010.gif" alt="estadísticas del blog" width="532" height="249" /></a></p>
<p>Es la primera vez que rondo las <strong>7000 visitas por mes</strong>, estos dos últimos meses venía rondando las 5000 y la verdad que cada vez crece más rápido. Esperemos que siga así.</p>
<p>Creo que este incremento se debe principalmente a los últimos <a title="Plugins de Timersys" href="http://masquewordpress.com/plugins/">plugins</a> que realice tanto de <a href="http://masquewordpress.com/category/wordpress/">WordPress</a> como de <a href="http://masquewordpress.com/category/jquery/">JQuery</a> y el intentar escribir cosas que están a la última.</p>
<h3>Páginas más vistas</h3>
<ol>
<li><a href="../tutoriales/actualizar-twitter-a-traves-de-php-y-oauth/">Actualizar Twitter a traves de PHP y OAuth | Timersys</a> &#8211; 427 Views</li>
<li><a href="../ejemplos/enviar-formulario-mediante-ajax/">Timersys</a> &#8211; 411 Views</li>
<li><a href="../jquery/como-redondear-las-esquinas-de-un-div-con-jquery-corners/">Como redondear las esquinas de un DIV con jquery.corners | Timersys</a> &#8211; 369 Views</li>
<li><a href="../jquery/jquery-scrollto-olvidate-de-usar-anchors-aburridos/">JQuery.ScrollTo , Olvidate de usar anchors aburridos | Timersys</a> &#8211; 360 Views</li>
<li><a href="../ejemplos/jcubeit-plugin/">JcubeiT Plugin</a> &#8211; 322 Views</li>
</ol>
<h3>Top Referrers</h3>
<ol>
<li><strong>plugins.jquery.com</strong> &#8211; 169 Visitas</li>
<li><strong>meneame.net</strong> &#8211; 101 Visitas</li>
<li><strong>forosdelweb.com</strong> &#8211; 80 Visitas</li>
<li><strong>google.es</strong> &#8211; 78 Visitas</li>
<li><strong>google.com.mx</strong> &#8211; 59 Visitas</li>
</ol>
<h3>Top Búsquedas</h3>
<ol>
<li><strong>jquery scrollto</strong> &#8211; 52 Visitas</li>
<li><strong>enviar formulario jquery</strong> &#8211; 35 Visitas</li>
<li><strong>redondear div jquery</strong> &#8211; 35 Visitas</li>
<li><strong>scrollto jquery</strong> &#8211; 35 Visitas</li>
<li><strong>ajax auto suggest</strong> &#8211; 21 Visitas</li>
</ol>
<p>No se si esperaban más o menos visitas, pero la verdad que las que hay me hacen feliz así que me despido dándoles las gracias una vez más.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/estadisticas-del-blog-septiembre-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JcubeiT &#8211; Plugin JQuery para hacer cubos  con HTML5</title>
		<link>http://www.masquewordpress.com/jcubeit-plugin-jquery-para-hacer-cubos-con-html5/</link>
		<comments>http://www.masquewordpress.com/jcubeit-plugin-jquery-para-hacer-cubos-con-html5/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 22:48:32 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[jquery.plugin]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=427</guid>
		<description><![CDATA[Buenas tardes!! Como ven sigo experimentando y haciendo plugins para JQuery. Hoy se me dio por hacer uno bastante gracioso basado en las explicaciones de lanrat acerca de como construir un cubo usando las nuevas propiedades CSS. Su utilización es muy sencilla, tan solo necesitamos 3 objetos ( las caras visibles del cubo) dentro de [...]]]></description>
			<content:encoded><![CDATA[<p>Buenas tardes!! Como ven sigo <a href="http://masquewordpress.com/jquery/jquery-nightmode-plugin/">experimentando</a> y haciendo <a href="http://masquewordpress.com/tag/jquery-plugin/">plugins</a> para JQuery.</p>
<p>Hoy se me dio por hacer uno bastante gracioso basado en las explicaciones de <a href="http://lanrat.com/code/html5-cube">lanrat</a> acerca de como construir un cubo usando <a href="http://masquewordpress.com/tutoriales/esquinas-redondeadas-y-degradados-con-css3/">las nuevas propiedades CSS</a>.</p>
<p style="text-align: center;"><img class="size-full wp-image-430  aligncenter" title="social" src="http://masquewordpress.com/wp-content/uploads/2010/06/social.gif" alt="" width="160" height="140" /></p>
<p>Su utilización es muy sencilla, tan solo necesitamos 3 objetos ( las caras visibles del cubo) dentro de un objeto contenedor. Dichos objetos pueden ser links , imágenes, otros divs, etc</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cube&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;3.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>Una vez que tenemos nuestra estructura HTML armada debemos aplicar el plugin de la siguiente forma:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.jcubeit.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<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;">'.cube'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">JcubeiT</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></pre></td></tr></table></div>

<p>Y voila!! Tendremos un cubo perfecto con el cual podremos hacer un poco más original nuestros diseños.</p>
<p>El plugin posee algunos <strong>valores por defecto</strong> que se pueden cambiar pasando opciones.</p>
<ul>
<li><strong>size</strong>:&#8217;200px&#8217;</li>
<li><strong>background</strong>: &#8216;#666&#8242;</li>
<li><strong>border</strong>: true</li>
<li><strong>borderColor</strong>: &#8216;#000&#8242;</li>
<li><strong>rounded</strong>: false</li>
</ul>
<p>Podemos cambiar estos valores pasando las opciones como se suele hacer en JQuery</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> opciones<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span> size<span style="color: #339933;">:</span><span style="color: #3366CC;">'100px'</span> <span style="color: #339933;">,</span> border<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.cube'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">JcubeiT</span><span style="color: #009900;">&#40;</span>opciones<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//o simplemente</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.cube'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">JcubeiT</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> size<span style="color: #339933;">:</span><span style="color: #3366CC;">'100px'</span> <span style="color: #339933;">,</span> border<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Jugando con las opciones podremos crear por ejemplo una barra de menu más original</p>
<p style="text-align: center;">
<img class="size-full wp-image-431  aligncenter" title="menu" src="http://masquewordpress.com/wp-content/uploads/2010/06/menu.gif" alt="" width="200" height="198" /></p>
<p>Pueden ver el <a href="http://masquewordpress.com/ejemplos/jcubeit-plugin/">ejemplo online</a> o <a href="http://plugins.jquery.com/files/jquery.jcubeit.zip">descargarse el código</a> desde la página oficial de JQuery</p>
<h2>ENGLISH</h2>
<p>Hello!As you see im still  <a href="http://masquewordpress.com/jquery/jquery-nightmode-plugin/">experiencing</a> and doing <a href="http://masquewordpress.com/tag/jquery-plugin/">plugins</a> for JQuery</p>
<p>Today I did a pretty funny one based on the explanations of  <a href="http://lanrat.com/code/html5-cube">lanrat</a>  about how to build a cube using <a href="http://masquewordpress.com/tutoriales/esquinas-redondeadas-y-degradados-con-css3/">new CSS properties</a>.</p>
<p style="text-align: center;"><img class="size-full wp-image-430  aligncenter" title="social" src="http://masquewordpress.com/wp-content/uploads/2010/06/social.gif" alt="" width="160" height="140" /></p>
<p>Its use is very simple,  you only need 3 objects (the visible faces of the cube) inside of a container object. Such objects could be links, images, other divs, etc.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cube&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;3.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>Once we have our HTML structure we have to apply the plugin like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.jcubeit.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<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;">'.cube'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">JcubeiT</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></pre></td></tr></table></div>

<p>And voila! We will have a perfect cube to be a little more original in our designs.</p>
<p>The plugin has some <strong>defaults  values</strong> that can be changed via the options var.</p>
<ul>
<li><strong>size</strong>:&#8217;200px&#8217;</li>
<li><strong>background</strong>: &#8216;#666&#8242;</li>
<li><strong>border</strong>: true</li>
<li><strong>borderColor</strong>: &#8216;#000&#8242;</li>
<li><strong>rounded</strong>: false</li>
</ul>
<p>We may change these values from the options as is usually done in JQuery</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> opciones<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span> size<span style="color: #339933;">:</span><span style="color: #3366CC;">'100px'</span> <span style="color: #339933;">,</span> border<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.cube'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">JcubeiT</span><span style="color: #009900;">&#40;</span>opciones<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//or just</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.cube'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">JcubeiT</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> size<span style="color: #339933;">:</span><span style="color: #3366CC;">'100px'</span> <span style="color: #339933;">,</span> border<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Playing with the options we can create for example a more original menu bar</p>
<p style="text-align: center;">
<img class="size-full wp-image-431  aligncenter" title="menu" src="http://masquewordpress.com/wp-content/uploads/2010/06/menu.gif" alt="" width="200" height="198" /></p>
<p>You can check the <a href="http://masquewordpress.com/ejemplos/jcubeit-plugin/">online demo</a> or <a href="http://plugins.jquery.com/files/jquery.jcubeit.zip">download the plugin</a> from JQuery </p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/jcubeit-plugin-jquery-para-hacer-cubos-con-html5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JQuery nightMode Plugin</title>
		<link>http://www.masquewordpress.com/jquery-nightmode-plugin/</link>
		<comments>http://www.masquewordpress.com/jquery-nightmode-plugin/#comments</comments>
		<pubDate>Sat, 01 May 2010 16:11:50 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[jquery.plugin]]></category>
		<category><![CDATA[nightMode]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=387</guid>
		<description><![CDATA[Download JQuery nightMode Plugin /////////////////////////ESPAÑOL ////////////////////// Anoche estaba aburrido y me puse a trabajar en un plugin para JQuery ya que nunca habia echo ninguno . Así nacio nightMode Plugin que es simplemente un script chiquitito que cambia el color de las letras y el fondo de pantalla. Con eso logramos ahorrar un poco de [...]]]></description>
			<content:encoded><![CDATA[<p>Download <a href="http://masquewordpress.com/plugins/jquery.nightmode.js">JQuery nightMode Plugin</a></p>
<p>/////////////////////////<strong>ESPAÑOL</strong> //////////////////////</p>
<p>Anoche estaba aburrido y me puse a trabajar en un plugin para JQuery ya que nunca habia echo ninguno . Así nacio <strong>nightMode</strong> Plugin que es simplemente un script chiquitito que cambia el color de las letras y el fondo de pantalla. Con eso logramos ahorrar un poco de energia apagando algunos pixeles de nuestra pantalla y además nos facilita la lectura. Espero que les guste!!</p>
<p>El color tanto de las letras o el fondo se puede cambiar pasando opciones.</p>
<p>Uso:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"> <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nightmode&quot;</span>&gt;</span>Turn nightmode On/off<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
               $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#nightmode'</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;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nightMode</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></pre></td></tr></table></div>

<p>Tan solo cambiar body por cualquier selector válido</p>
<p>También se puede ejecutar con opciones</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #003366; font-weight: bold;">var</span> options<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span>
      color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#ffffff'</span><span style="color: #339933;">,</span>
     background<span style="color: #339933;">:</span><span style="color: #3366CC;">'#ccc'</span>
 <span style="color: #009900;">&#125;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nightMode</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Pueden probar como funciona haciendo click en la lamparita que aparece en la parte superior derecha de mi blog <img src='http://www.masquewordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Descargar <a href="http://masquewordpress.com/plugins/jquery.nightmode.js">JQuery nightMode Plugin</a></p>
<p>////////////////////////<strong>ENGLISH</strong>/////////////////////////////<br />
<strong><br />
JQuery nightMode Plugin</strong> its a funny tiny plugin that will allow you to change your background and letter colors for a night mode. Saving energy turning off pixels of your screen and allowing you to have a confortable read .</p>
<p>Letter colors and background can be moddified by options</p>
<p>Ussage:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"> <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nightmode&quot;</span>&gt;</span>Turn nightmode On/off<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
               $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#nightmode'</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;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nightMode</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></pre></td></tr></table></div>

<p> Just change body to any valid selector you wish</p>
<p>Can also be called with options:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #003366; font-weight: bold;">var</span> options<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span>
      color<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#ffffff'</span><span style="color: #339933;">,</span>
      background<span style="color: #339933;">:</span><span style="color: #3366CC;">'#ccc'</span>
 <span style="color: #009900;">&#125;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nightMode</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>You can try how it works by clicking on the light bulb on the top right corner of my blog <img src='http://www.masquewordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Download <a href="http://masquewordpress.com/plugins/jquery.nightmode.js">JQuery nightMode Plugin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/jquery-nightmode-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Como crear una página de lanzamiento con PHP, AJAX y JQuery &#8211; II Parte</title>
		<link>http://www.masquewordpress.com/como-crear-una-pagina-de-lanzamiento-con-php-ajax-y-jquery-ii-parte/</link>
		<comments>http://www.masquewordpress.com/como-crear-una-pagina-de-lanzamiento-con-php-ajax-y-jquery-ii-parte/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 21:29:49 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[jquery.plugin]]></category>
		<category><![CDATA[pagina lanzamiento]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=222</guid>
		<description><![CDATA[Hoy les voy a explicar como crear un formulario AJAX para nuestra página de lanzamiento y así poder crear una base de datos con los emails de nuestros visitantes que quieren manternerse actualizados con novedades, etc. Siguiendo la estructura básica de una web vamos a necesitar varios archivos para lo que queremos hacer: config/db.php Archivo [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy les voy a explicar como crear <a title="Como crear formulario AJAX" href="http://masquewordpress.com/jquery/como-enviar-un-formulario-via-ajax-con-jquery/">un formulario AJAX</a> para nuestra <a title="Crear una página de lanzamiento con PHP AJAX y JQuery" href="http://masquewordpress.com/jquery/como-crear-una-pagina-de-lanzamiento-con-php-ajax-y-jquery/">página de lanzamiento</a> y así poder crear una base de datos con los emails de nuestros visitantes que quieren manternerse actualizados con novedades, etc.</p>
<p style="text-align: center;"><img class="size-full wp-image-206  aligncenter" title="cuenta-atras" src="http://masquewordpress.com/wp-content/uploads/2009/07/pagina-lanzamiento.png" alt="cuenta-atras" /></p>
<p style="text-align: left;">Siguiendo la <a title="Introducción al diseño web" href="http://masquewordpress.com/tutoriales/introduccion-al-diseno-web-con-php-css-parte-i/">estructura básica </a>de una web vamos a necesitar varios archivos para lo que queremos hacer:</p>
<ul>
<li><a href="http://masquewordpress.com/php/dbphp-como-definir-los-parametros-de-conexion-de-tu-base-de-datos/"><strong>config/db.php</strong></a> Archivo donde configuramos los parametros de conexión a la base de datos</li>
<li><strong>ajax_usuarios.php</strong> Archivo encargado de recibir la petición AJAX e ingresar los emails en la base de datos</li>
<li><strong>index.php </strong>Página de lanzamiento que veran los usuarios</li>
<li><strong>css/estilo.css </strong>Página con código CSS</li>
<li><a href="http://jquery.com/"><strong>js/jquery-latest.js</strong> </a>Última versión de JQuery</li>
<li><a href="http://masquewordpress.com/jquery/como-redondear-las-esquinas-de-un-div-con-jquery-corners/"><strong>js/jquery.corners.js</strong></a> Plugin para redondear esquinas</li>
<li><a href="http://masquewordpress.com/jquery/como-crear-una-pagina-de-lanzamiento-con-php-ajax-y-jquery/"><strong>js/jquery.epiclock.js</strong></a> Plugin para crear cuenta atras</li>
<li><a href="http://masquewordpress.com/jquery/como-enviar-un-formulario-via-ajax-con-jquery/"><strong>js/jquery.form.js</strong></a> Plugin para enviar formulario via AJAX</li>
<li><a href="http://masquewordpress.com/recursos/jqtransform-aplica-estilo-a-tus-formularios-de-una-forma-sencilla/"><strong>js/jquery.jqtransform.js</strong></a> Plugin para dar estilo al formulario.
</ul>
<p>Como ya tenemos definido el archivo db.php tal y como <a href="http://masquewordpress.com/php/dbphp-como-definir-los-parametros-de-conexion-de-tu-base-de-datos/">se explico en su día</a> , pasamos al archivo<strong> ajax_usuarios.php</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// compruena la variable $_POST </span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_POST</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: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #666666; font-style: italic;">/* Conectamos a la base de datos */</span>
     <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'config/db.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$conn</span><span style="color: #339933;">=</span>get_db_conn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #666666; font-style: italic;">/* Protejo SQL injection */</span>
     <span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> cleanQuery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #666666; font-style: italic;">/* Realizo consulta SQL */</span>
     <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO listado_emails (email) VALUES ('<span style="color: #006699; font-weight: bold;">$email</span>')&quot;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">,</span><span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Mensaje de respuesta</span>
     <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$email</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">' fue ingresado a la base de datos correctamente!!!!!!'</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: #666666; font-style: italic;">// En caso de q la variable no este iniciado o no tenga caracteres el mensaje de respuesta es el siguiente</span>
 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Hubo un error, intenta otra ves.'</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>El código de index.php también va a cambiar ya que agregamos nuevos plugins de JQuery y el formulario para ingresar emails<br />
<strong><br />
index.php</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=ISO-8859-1&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Timersys<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css/estilo.css&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css/jqtransform.css&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;../jquery.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.epiclock.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.corners.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.form.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.jqtransform.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
$(document).ready(function(){
	// Cuenta atras					   
	   jQuery('#text').epiclock({mode: EC_COUNTDOWN, format: 'V{<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">sup</span>&gt;</span>dias<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">sup</span>&gt;</span>} x{<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">sup</span>&gt;</span>horas<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">sup</span>&gt;</span>} i{<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">sup</span>&gt;</span>minutos<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">sup</span>&gt;</span>} s{<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">sup</span>&gt;</span>segundos<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">sup</span>&gt;</span>}', target: 'January 1, 2012 00:00:00'}).clocks(EC_RUN);  
&nbsp;
	   //Esquinas redondeadas
	   $('.rounded').corners('transparent');
&nbsp;
	   //Transformar el formulario
	   $(&quot;form.jqtransform&quot;).jqTransform();
&nbsp;
&nbsp;
	   // definimos las opciones del plugin AJAX FORM
            var opciones= {
&nbsp;
                               success: mostrarRespuesta //funcion que se ejecuta una vez enviado el formulario
            };
             //asignamos el plugin ajaxForm al formulario email_list y le pasamos las opciones
            $('#email_list').ajaxForm(opciones) ;
&nbsp;
             //lugar donde defino las funciones que utilizo dentro de &quot;opciones&quot;
&nbsp;
             function mostrarRespuesta (responseText){
                          $(&quot;#update&quot;).fadeOut(&quot;slow&quot;); // Hago desaparecer el formulario
                          $(&quot;#succes&quot;).fadeIn(&quot;slow&quot;).html(responseText); //muestro mensaje 
             };
&nbsp;
&nbsp;
		});
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> 
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>Como crear una P<span style="color: #ddbb00;">&amp;aacute;</span>gina de lanzamiento. M<span style="color: #ddbb00;">&amp;aacute;</span>s tutoriales en: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://masquewordpress.com&quot;</span>&gt;</span>http://masquewordpress.com<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wrapper&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cuadro2&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;rounded&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;count_down&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;update&quot;</span>&gt;</span>
&nbsp;
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email_list&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jqtransform&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ajax_usuarios.php&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;input_text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Ingresa tu email para recibir actualizaciones&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;this.select();&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ENVIAR&quot;</span>  <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;input_button&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;succes&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Con esto y un poco de código CSS ya tendriamos nuestra página de lanzamiento lista , y ademas podriamos juntar una base de datos con emails de los usuarios para poder enviarles actualizaciones.</p>
<p>Como siempre pueden ver el <a href="http://masquewordpress.com/ejemplos/pagina-de-lanzamiento/">EJEMPLO TERMINADO</a></p>
<p>Y descargar el <a href="http://masquewordpress.com/ejemplos/pagina-de-lanzamiento-II.zip">código fuente</a> .( Recuerden de editar el archivo db.php con los datos de su propia base de datos y crear las tablas necesarias)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/como-crear-una-pagina-de-lanzamiento-con-php-ajax-y-jquery-ii-parte/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jqTransform : Aplica estilo a tus formularios de una forma sencilla</title>
		<link>http://www.masquewordpress.com/jqtransform-aplica-estilo-a-tus-formularios-de-una-forma-sencilla/</link>
		<comments>http://www.masquewordpress.com/jqtransform-aplica-estilo-a-tus-formularios-de-una-forma-sencilla/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 21:17:01 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Recursos]]></category>
		<category><![CDATA[jquery.plugin]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=251</guid>
		<description><![CDATA[Con jqTransform nunca fue tan facil modificar el aspecto de un formulario dandole un aire elegante en cualquier navegador. La forma de implementarlos es como siempre super sencilla: 1- Añadir el plugin a la cabezera de tu web 1 &#60;script src=&#34;js/jquery.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62; &#60;script src=&#34;js/jquery.jqtransform.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62; 2- Escribir un formulario y añadirle la clase correspondiente 1 [...]]]></description>
			<content:encoded><![CDATA[<p>Con <a title="jqTransform" href="http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/"><strong>jqTransform</strong></a> nunca fue tan facil modificar el aspecto de un formulario dandole un aire elegante en cualquier navegador.</p>
<p style="text-align: center;"><img class="size-full wp-image-252  aligncenter" title="jqtransform" src="http://masquewordpress.com/wp-content/uploads/2009/08/jqtransform.png" alt="jqtransform" width="358" height="111" /></p>
<p style="text-align: left;">La forma de implementarlos es como siempre super sencilla:</p>
<h3>1- Añadir el plugin a la cabezera de tu web</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script 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 src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery.jqtransform.min.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></pre></td></tr></table></div>

<h3>2- Escribir un formulario y añadirle la clase correspondiente</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jqtransform&quot;</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name&quot;</span>&gt;</span>Name: <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;send&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></pre></td></tr></table></div>

<h3>3- Activar el plugin</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #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: #006600; font-style: italic;">//Todos los formularios con clase jqtransform</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form.jqtransform&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">jqTransform</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></pre></td></tr></table></div>

<p style="text-align: left;">
<p>Como ven , super sencillo de usar. Para descargarlo visiten la <a href="http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/">página del autor</a>.</p>
<p>Para ver un ejemplo online pueden ver el usado en este <a href="http://masquewordpress.com/jquery/como-crear-una-pagina-de-lanzamiento-con-php-ajax-y-jquery-ii-parte/">tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/jqtransform-aplica-estilo-a-tus-formularios-de-una-forma-sencilla/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Crear gráficos dinámicos con JQuery Visualize</title>
		<link>http://www.masquewordpress.com/crear-graficos-dinamicos-con-jquery-visualize/</link>
		<comments>http://www.masquewordpress.com/crear-graficos-dinamicos-con-jquery-visualize/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 18:12:25 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Recursos]]></category>
		<category><![CDATA[graficas]]></category>
		<category><![CDATA[jquery.plugin]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=211</guid>
		<description><![CDATA[Hoy dando una vuelta por la web de Andrés Nieto me encontre con este peculiar plugin llamado JQuery Visualize que se encarga de formar gráficas a partir de los datos de una tabla. Entre sus posibilidades podemos encontrar desde barras normales , areas, gráficas en queso , etc y lo mejor de todo es que [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Hoy dando una vuelta por la web de<a href="http://www.anieto2k.com"> Andrés Nieto</a> me encontre con este peculiar plugin llamado <a href="http://www.filamentgroup.com/lab/jquery_visualize_plugin_accessible_charts_graphs_from_tables_html5_canvas">JQuery Visualize</a> que se encarga de formar gráficas a partir de los datos de una tabla. Entre sus posibilidades podemos encontrar desde barras normales , areas, gráficas en queso , etc y lo mejor de todo es que si el visitante no dispone de Javascript podra ver la tabla en vez de la gráfica.<br />
<img class="size-full wp-image-213  aligncenter" title="jquery.visualize" src="http://masquewordpress.com/wp-content/uploads/2009/07/jquery.visualize1.JPG" alt="jquery.visualize" width="528" height="238" /></p>
<p style="text-align: left;">La forma en que funciona es muy sencilla. Dada una tabla cualquiera como :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">table</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">caption</span>&gt;</span>2009 Individual Sales by Category<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">caption</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">thead</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>food<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>auto<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>household<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>furniture<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>kitchen<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>bath<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">thead</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tbody</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>Mary<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>150<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>160<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>40<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>120<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>30<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>70<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>Tom<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>40<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>30<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>45<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>35<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>49<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
		...Las columnas repetidas las saco por brevedad
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tbody</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">table</span>&gt;</span></pre></td></tr></table></div>

<p>Tan solo hay que llamar al plugin de la siguiente forma y el plugin se va a encargar de generar la gráfica a partir de los datos introducidos.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'table'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">visualize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>options<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Además podemos definir las siguiente opciones:</p>
<ul>
<li><strong>type:</strong> string. Valors aceptados ‘bar’, ‘area’, ‘pie’, ‘line’. Default: ‘bar’.</li>
<li><strong>width:</strong> number. Ancho de la gráfica. Por defecto el tamaño de la tabla.</li>
<li><strong>height</strong>: number. Altura de la gráfica. Por defecto el tamaño de la tabla.</li>
<li><strong>appendTitle</strong>: boolean. Añadir título a la gráfica. Default: true.</li>
<li><strong>title</strong>: string. Título de la gráfica. Por defecto se usa el<br />
<caption /> de la tabla.</li>
<li><strong>appendKey</strong>: boolean. Añadir color principal. Default: true.</li>
<li><strong>colors</strong>: array. Array de colores usados. Default:['#be1e2d','#666699','#92d5ea','#ee8310','#8d10ee','#5a3b16','#26a4ed','#f45a90','#e9e744']</li>
<li> <strong>textColors</strong>: array. Array de colores para el texto. Default: [].</li>
<li><strong>parseDirection</strong>: string. Dirección de parseo de datos de la tabla Acepta ‘x’ e ‘y’. Default: ‘x’.</li>
<li><strong>pieMargin</strong>: number.Espacio alrededor de la gráfica tipo “Pie”. Default: 20.</li>
<li><strong>pieLabelPos</strong>: string. Posición del texto de etiqueta en la gráfica tipo “Pie”. Acepta ‘inside’ y ‘outside’. Default: ‘inside’.</li>
<li><strong>lineWeight</strong>: number. Tamaño de la línea de la gráfica. Default: 4.</li>
<li><strong>barGroupMargin</strong>: number. Espacio entre barras. Default: 10.</li>
<li><strong>barMargin</strong>: number.Margenes de la gráfica. Default: 1</li>
</ul>
<p>Pueden ver una gráfica dinámica desde <a href="http://www.filamentgroup.com/examples/charting_v2/index_2.php">este enlace</a> o<a href="http://www.filamentgroup.com/lab/jquery_visualize_plugin_accessible_charts_graphs_from_tables_html5_canvas"> descargar el plugin directamente.</a><br />
Un saludo a todos.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/crear-graficos-dinamicos-con-jquery-visualize/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Como crear una página de lanzamiento con PHP, AJAX y JQuery</title>
		<link>http://www.masquewordpress.com/como-crear-una-pagina-de-lanzamiento-con-php-ajax-y-jquery/</link>
		<comments>http://www.masquewordpress.com/como-crear-una-pagina-de-lanzamiento-con-php-ajax-y-jquery/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 00:12:33 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[jquery.plugin]]></category>
		<category><![CDATA[pagina lanzamiento]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=202</guid>
		<description><![CDATA[En este tutorial les voy a enseñar como hacer una página de lanzamiento como la que en ocasiones nos encontramos cuando visitamos una web sin estrenar con su cuenta atras correspondiente. Además de la cuenta atras más adelante vamos a añadir un pequeño formulario de  contácto con AJAX para añadir emails a una base de [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">En este tutorial les voy a enseñar como hacer una página de lanzamiento como la que en ocasiones nos encontramos cuando visitamos una web sin estrenar con su cuenta atras correspondiente. Además de la cuenta atras más adelante vamos a añadir un pequeño <a title="Enviar formulario via AJAX" href="http://masquewordpress.com/jquery/como-enviar-un-formulario-via-ajax-con-jquery/">formulario de  contácto con AJAX</a> para añadir emails a una base de datos y asi poder mantener a los visitantes actualizados.</p>
<p style="text-align: center;">
<img class="size-full wp-image-203  aligncenter" title="cuenta-atras" src="http://masquewordpress.com/wp-content/uploads/2009/07/cuenta-atras1.png" alt="cuenta-atras" width="450px" height="123px"/></p>
<p style="text-align: left;">Para empezar vamos a necesitar un plugin de JQuery muy completo llamado <a title="epiClock Plugin" href="http://eric.garside.name/demo.html?p=epiclock">epiClock</a> que va a ser el encargado de realizar la cuenta atras. La verdad que vale la pena echar una ojeada a la página de epiClock , ya que además de cuentas atras podemos crear todo tipo de relojes, cronometros , etc.</p>
<p style="text-align: left;">
<p style="text-align: left;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery-latest.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.epiclock.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p style="text-align: left;">
<p style="text-align: left;">
<p>Si queremos por ejemplo hacer una cuenta atras hasta el 2012 es tan facil como poner:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">//espero que cargue el DOM y llamo al plugin</span>
  j jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#reloj'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">epiclock</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>mode<span style="color: #339933;">:</span> EC_COUNTDOWN<span style="color: #339933;">,</span> format<span style="color: #339933;">:</span> <span style="color: #3366CC;">'V{&lt;sup&gt;dias&lt;/sup&gt;} x{&lt;sup&gt;horas&lt;/sup&gt;} i{&lt;sup&gt;minutos&lt;/sup&gt;} s{&lt;sup&gt;segundos&lt;/sup&gt;}'</span><span style="color: #339933;">,</span> target<span style="color: #339933;">:</span> <span style="color: #3366CC;">'January 1, 2012 00:00:00'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">clocks</span><span style="color: #009900;">&#40;</span>EC_RUN<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p style="text-align: left;">
<p>Como pueden ver le paso tres parametros a <strong>.epiclock</strong> :</p>
<ul>
<li><strong>mode: </strong> El modo de cuenta atras (countdown).</li>
<li><strong>format:</strong> El formato que quiero que en este caso es &#8216;&lt;sup&gt;dias&lt;/sup&gt;&#8217; para los dias y así susecivamente.</li>
<li><strong>target:</strong> El tiempo final del contador pasado en modo de fecha.
</li>
</ul>
<p style="text-align: left;">
<p style="text-align: left;">
<p>Y por último inicio el contador con <strong>.clocks(EC_RUN)</strong></p>
<p>Una ves que tengo el reloj definido voy a crear el código HTML necesario para que funcione:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>Como crear una P<span style="color: #ddbb00;">&amp;aacute;</span>gina de lanzamiento. M<span style="color: #ddbb00;">&amp;aacute;</span>s tutoriales en: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://masquewordpress.com&quot;</span>&gt;</span>http://masquewordpress.com<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wrapper&quot;</span>&gt;</span>
           <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cuadro2&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;rounded&quot;</span>&gt;</span>
               <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;reloj&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;count_down&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
           <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p style="text-align: left;">
<p style="text-align: left;">
<p>Y le aplico el siguiente estilo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span><span style="color: #ff0000;">'Trebuchet MS'</span><span style="color: #00AA00;">,</span><span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">14px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.5em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">justify</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#header</span><span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">80px</span><span style="color: #00AA00;">;</span> 
 <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
 <span style="color: #00AA00;">&#125;</span> 
<span style="color: #cc00cc;">#cuadro2</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#EEEEEE</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCCCCC</span><span style="color: #00AA00;">;</span>
&nbsp;
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#wrapper</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">440px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.count_down<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Georgia</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Times New Roman&quot;</span><span style="color: #00AA00;">,</span> Times<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">38px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#222</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.count_down</span> sup<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span><span style="color: #ff0000;">&quot;Lucida Grande&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Lucida Sans Unicode&quot;</span><span style="color: #00AA00;">,</span> Verdana<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#555</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Como toque final voy a redondear las esquinas del DIV contenedor del reloj con jquery.corners como <a href="http://masquewordpress.com/jquery/como-redondear-las-esquinas-de-un-div-con-jquery-corners/">vimos anteriormente</a> en el blog.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> $<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.rounded'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>corners<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'transparent'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p style="text-align: left;">
<p style="text-align: left;">
<p>Y con eso tendriamos nuestra cuentra atras particular. En el próximo tutorial les explico como crear un formulario con AJAX para guardar todos los emails en una base de datos de forma que podamos mantener actualizados con noticias a nuestros seguidores.<br />
<a href="http://masquewordpress.com/ejemplos/pagina-de-lanzamiento/">Ver Ejemplo Online</a><br />
<a href="http://masquewordpress.com/ejemplos/pagina-de-lanzamiento.zip">Descargar código</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/como-crear-una-pagina-de-lanzamiento-con-php-ajax-y-jquery/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>JQuery.ScrollTo , Olvidate de usar anchors aburridos</title>
		<link>http://www.masquewordpress.com/jquery-scrollto-olvidate-de-usar-anchors-aburridos/</link>
		<comments>http://www.masquewordpress.com/jquery-scrollto-olvidate-de-usar-anchors-aburridos/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 23:01:46 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[jquery.plugin]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=198</guid>
		<description><![CDATA[Hoy les traigo otro plugin de JQuery que hace la nevagación un poco más facil . Con JQuery.ScrollTo podemos darle movimiento a una ventana o a un anchor por ejemplo. Como el nombre indica básicamente lo que hace es un scroll ( como cuando usamos la ruedita del mouse) tanto en sentido horizontal como vertical [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy les traigo otro plugin de JQuery que hace la nevagación un poco más facil . Con <a title="Jquery.scrollto" href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html" target="_blank">JQuery.ScrollTo </a>podemos darle movimiento a una ventana o a un anchor por ejemplo. Como el nombre indica básicamente lo que hace es un scroll ( como cuando usamos la ruedita del mouse) tanto en sentido horizontal como vertical o ambos a la vez.</p>
<p>Esto es útil cuando tenemos una página bastante larga y no queremos que los clientes se cansen de ir un lado para otro. Hace unos meses un cliente me pidio una web para mostrar sus productos y queria algo muy sencillo donde todos los productos aparecieran en la página principal. Cuando empeze con la web me di cuenta que tardaba mucho en ir de un lado a otro así que fui poniendo scrolls en diferentes partes de la web para subir al top y despues cree un menu para que haga scroll a los diferentes tipos de productos. Si quieren ver de lo que hablo pueden visitar la web de <a title="Photo Momentos" href="http://photo-momentos.com/" target="_blank">Photo Momentos</a>.</p>
<p>Para usar este plugin como siempre debemos usar la última versión de <a href="http://jquery.com/" target="_blank">JQuery</a> y el plugin <a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.htmlhttp://flesler.blogspot.com/2007/10/jqueryscrollto.html" target="_blank">JQuery.Scroll</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery-latest.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.scrollTo.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>Para realizar un scroll tan solo debemos crear un link o anchor apuntando al id del elemento destino:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:$.scrollTo('#destino',800);&quot;</span>&gt;</span>Destino<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></td></tr></table></div>

<p>Digamos que el destino seria algo así:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;destino&quot;</span>&gt;</span>..... Final de la web.....<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>Más simple imposible&#8230;<br />
<a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html">JQuery.ScrollTo</a> tiene un montón más de opciones como duración, funciones callback , etc&#8230; pero lo básico ya esta explicado.<br />
Un saludo a todos y dejen comentarios</p>
<p><a href="http://masquewordpress.com/ejemplos/scroll-con-jquery/">Ver Ejemplo</a><br />
<a href="http://masquewordpress.com/ejemplos/scroll-con-jquery.zip">Descargar Ejemplo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/jquery-scrollto-olvidate-de-usar-anchors-aburridos/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

