<?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>TutsNT &#187; HTML5</title>
	<atom:link href="http://www.tutsnt.com/category/tutoriales/html5/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tutsnt.com</link>
	<description>Tips de Desarrollo Web y más...</description>
	<lastBuildDate>Fri, 30 Nov 2012 20:05:13 +0000</lastBuildDate>
	<language>es-ES</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Crear un TimeLine estilo Facebook con CSS y jQuery</title>
		<link>http://www.tutsnt.com/crear-un-timeline-estilo-facebook-con-css-y-jquery/</link>
		<comments>http://www.tutsnt.com/crear-un-timeline-estilo-facebook-con-css-y-jquery/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 23:03:28 +0000</pubDate>
		<dc:creator>Neysi</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[JavasScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Timeline]]></category>

		<guid isPermaLink="false">http://www.tutsnt.com/?p=452</guid>
		<description><![CDATA[Hoy no será un día como los demás, porque les enseñaré como diseñar un Timeline como Facebook. Este último arrasó desde su lanzamiento hace aproximadamente tres meses y se convirtió en el sueño de cualquier programador Web. El Timeline de Facebook gano terreno con su simplicidad y buen diseño. Lo<a title="Continuar leyendo..." href="http://www.tutsnt.com/crear-un-timeline-estilo-facebook-con-css-y-jquery/"> continuar &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Hoy no será un día como los demás, porque les enseñaré como diseñar un Timeline como Facebook. Este último arrasó desde su lanzamiento hace aproximadamente tres meses y se convirtió en el sueño de cualquier programador Web. El Timeline de Facebook gano terreno con su simplicidad y buen diseño.</p>
<p style="text-align: justify;">Lo que haremos en este artículo será algo muy exclusivo, les mostraré paso a paso y con imágenes explicativas como programar el Timeline. Utilizaremos CSS &amp; el Framework jQuery.</p>
<p><a href="http://www.tutsnt.com/wp-content/uploads/2012/02/1.png"><img class="aligncenter size-full wp-image-453" title="1" src="http://www.tutsnt.com/wp-content/uploads/2012/02/1.png" alt="" width="550" height="300" /></a></p>
<h2>Paso 1: Crear diseño HTML.</h2>
<p>Primero crearemos un elemento DIV, La ID la llamaremos container. Luego creamos DIVS múltiples y le damos a la Class el valor ítem.</p>
<pre>&lt;div id="container"&gt;
&lt;div&gt;1&lt;/div&gt;
 &lt;div&gt;2&lt;/div&gt;
 &lt;div&gt;3&lt;/div&gt;
 &lt;div&gt;4&lt;/div&gt;
&lt;/div&gt;</pre>
<p>Agregamos un poco de CSS para mejorar el diseño.</p>
<p><a href="http://www.tutsnt.com/wp-content/uploads/2012/02/2.png"><img class="aligncenter size-full wp-image-454" title="2" src="http://www.tutsnt.com/wp-content/uploads/2012/02/2.png" alt="" width="550" height="365" /></a></p>
<p><strong>Codigo CSS:</strong></p>
<pre>#container{width:860px; margin: 0 auto; }
 .item {
 width: 408px;
 margin: 20px 10px 10px 10px;
 float: left;
 background-color:#ffffff;
 border:solid 1px #B4BBCD;
 min-height:50px;
 text-align:justify;
 word-wrap:break-word;
 }</pre>
<h2>Paso 2: Quitar los espacios.</h2>
<p>Usaremos el plugin <a href="http://masonry.desandro.com/">Mansory</a> para eliminar los espacios entre las DIVS.</p>
<pre>&lt;script type="text/javascript" src="http://ajax.googleapis.com/
 ajax/libs/jquery/<strong>1.5</strong>/jquery.min.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript" src="jquery.masonry.min.js"/&gt;
 &lt;script type="text/javascript" &gt;
 $(<strong>function</strong>()
 {
 $('#container').masonry({itemSelector : '.item',});
 });
 &lt;/script&gt;</pre>
<p>Después de utilizar el plugin Mansory:</p>
<p><a href="http://www.tutsnt.com/wp-content/uploads/2012/02/3.png"><img class="aligncenter size-full wp-image-455" title="3" src="http://www.tutsnt.com/wp-content/uploads/2012/02/3.png" alt="" width="550" height="365" /></a></p>
<h2>Paso 3: Navegador Timeline.</h2>
<p>Ahora crea un “<em>timeline_container” DIV dentro del DIV “container”. Este DIV contendrá un segundo Div, lo llamaremos </em>“plus”</p>
<p><a href="http://www.tutsnt.com/wp-content/uploads/2012/02/4.png"><img class="aligncenter size-full wp-image-456" title="4" src="http://www.tutsnt.com/wp-content/uploads/2012/02/4.png" alt="" width="550" height="365" /></a></p>
<pre>&lt;div id="container"&gt;
 &lt;div&gt;
 &lt;div&gt;
 &lt;div&gt;&lt;/div&gt;
 &lt;/div&gt;
 &lt;/div&gt;

 &lt;div&gt;1&lt;/div&gt;
 --------
 --------

 &lt;/div&gt;</pre>
<p>Ahora insertaremos un código Javascript para centrar el navegador del Timeline.</p>
<pre>$('.timeline_container').mousemove(<strong>function</strong>(e)
 {
 <strong>var</strong> topdiv=$("#containertop").height();
 <strong>var</strong> pag= e.pageY - topdiv-26;
 $('.plus').css({"top":pag +"px", "background":"url('images/plus.png')","margin-left":"1px"});}).
 mouseout(<strong>function</strong>()
 {
 $('.plus').css({"background":"url('')"});
 });</pre>
<p>Y un poco de CSS para dar estilo.</p>
<pre>.timeline_container{
 width: 16px;
 text-align: center;
 margin: 0 auto;
 cursor:pointer;
 display: block;
 }
 .timeline{
 margin: 0 auto;
 background-color:#e08989;
 display: block;
 float: left;
 height: 100%;
 left: 428px;
 margin-top: 10px;
 position: absolute;
 width: 4px;
 }
 .timeline:hover{cursor: pointer;margin: 0 auto;}
 .timeline div.plus{width: 14px;height: 14px;position: relative;left: -6px;}</pre>
<h2>Paso 4: Inyección de flechas en los contenedores.</h2>
<p>Buscaremos los contenedores con este código <em>$(&#8216;#container&#8217;).find(&#8216;.item&#8217;) y luego inyectaremos las flechas </em></p>
<pre><strong>function</strong> <strong>Arrow_Points</strong>()
 { 
 var s = $('#container').find('.item');
 $.each(s,<strong>function</strong>(i,obj){
 <strong>var</strong> posLeft = $(obj).css("left");
 $(obj).addClass('borderclass');
 if(posLeft == "0px")
 {
 html = "&lt;span class='rightCorner'&gt;&lt;/span&gt;";
 $(obj).prepend(html); 
 }
 else
 {
 html = "&lt;span class='leftCorner'&gt;&lt;/span&gt;";
 $(obj).prepend(html);
 }
 });
 }</pre>
<p><a href="http://www.tutsnt.com/wp-content/uploads/2012/02/5.png"><img class="aligncenter size-full wp-image-457" title="5" src="http://www.tutsnt.com/wp-content/uploads/2012/02/5.png" alt="" width="550" height="365" /></a></p>
<p><strong>Código CSS:</strong></p>
<pre>.rightCorner { 
 background-image: url("images/right.png");
 display: block;
 height: 15px;
 margin-left: 408px;
 margin-top: 8px;
 padding: 0;
 vertical-align: top;
 width: 13px;
 z-index:2;
 position: absolute;
 }
 .leftCorner{
 background-image: url("images/left.png");
 display: block;
 height: 15px;
 width: 13px;
 margin-left: -13px;
 margin-top: 8px;
 position: absolute;
 z-index:2;
 }</pre>
<h2>Paso 5: Bloque de eliminación.</h2>
<p>Añadiremos Link para eliminar los contenedores seleccionados por el usuario.</p>
<pre>&lt;div id="container"&gt;

 &lt;div&gt;
 &lt;a href='#' class='deletebox'&gt;X&lt;/a&gt;
 1
 &lt;/div&gt;
 &lt;div&gt;
 &lt;a href='#' class='deletebox'&gt;X&lt;/a&gt;
 2
 &lt;/div&gt;
 -----------
 -----------
 -----------

 &lt;/div&gt;</pre>
<p><strong>Código Javascript:</strong></p>
<pre>$(".deletebox").live('click',<strong>function</strong>()
 {
 if(confirm("Are your sure?"))
 {
 $(<strong>this</strong>).parent().fadeOut('slow'); 
 $('#container').<strong>masonry</strong>( 'remove', $(<strong>this</strong>).parent() );
 $('#container').<strong>masonry</strong>( 'reload' );
 $('.rightCorner').hide();
 $('.leftCorner').hide();
 <strong>Arrow_Points</strong>();
 }
 return false;
 });</pre>
<h2>Paso 6: Contenedor para añadir estado.</h2>
<pre>&lt;div id="container"&gt;

 &lt;div&gt;1&lt;/div&gt;
 --------
 --------

 &lt;div id="popup" class='shade'&gt;
 &lt;div &gt; &lt;/div&gt;
 Que hay de Nuevo?
 &lt;textarea id='update'&gt;&lt;/textarea&gt;
 &lt;input type='submit' value=' Update ' id='update_button'/&gt;
 &lt;/div&gt;
 &lt;/div&gt;</pre>
<p><strong>Código Javascript:</strong></p>
<pre>$(".timeline_container").click(<strong>function</strong>(e)
 {
 <strong>var</strong> topdiv=$("#containertop").height();
 $("#popup").css({'top':(e.pageY-topdiv-33)+'px'});
 $("#popup").fadeIn();
$("#update").focus();
 }); 
 $("#popup").mouseup(<strong>function</strong>() {<strong>return false</strong>});
 $(document).mouseup(<strong>function</strong>(){$('#popup').hide();});
 $("#update_button").live('click',<strong>function</strong>()
 {
 <strong>var</strong> x=$("#update").val();
 $("#container").prepend('&lt;div class="item"&gt;&lt;a href="#" class="deletebox"&gt;X&lt;/a&gt;'+<strong>x</strong>+'&lt;/div&gt;');
 $('#container').<strong>masonry</strong>( 'reload' );
 $('.rightCorner').hide();
 $('.leftCorner').hide();
 <strong>Arrow_Points</strong>();
 $("#update").val('');
 $("#popup").hide();
 return false;
 });</pre>
<p><strong>Código</strong><strong> CSS:</strong></p>
<pre>#popup{ 
 display: block;width: 408px;
 float: left;margin-top:10px;
 background-color:#ffffff;
 border:solid 1px #A9B6D2;
 min-height:60px;display:none;
 position:absolute;margin:10px;
 }</pre>
<p>Ya tenemos nuestro Timeline finalizado solo queda <strong><a href="http://www.tutsnt.com/timeline/">ver la demostración</a> </strong>o<strong> <a href="http://http://www.tutsnt.com/timeline/Demo_timeline.zip">Descargar el ejemplo.</a></strong></p>
<blockquote><p>Tutorial original por <strong>9lessons</strong>, publicado con autorización oficial.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.tutsnt.com/crear-un-timeline-estilo-facebook-con-css-y-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ejemplo de Geolocalización  con HTML5 y Google Maps</title>
		<link>http://www.tutsnt.com/ejemplo-de-geolocalizacion-con-html5-y-google-maps/</link>
		<comments>http://www.tutsnt.com/ejemplo-de-geolocalizacion-con-html5-y-google-maps/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 07:35:45 +0000</pubDate>
		<dc:creator>Neysi</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Geolocalización]]></category>
		<category><![CDATA[Google Maps]]></category>

		<guid isPermaLink="false">http://www.tutsnt.com/?p=95</guid>
		<description><![CDATA[Existen muchas técnicas para localizar un dispositivo a través de Internet, anteriormente para obtener la ubicación se necesitaba saber la dirección IP del cliente . Actualmente gracias  a la W3C que ha incluido en HTML5 un conjunto de APIS que permiten a cualquier dispositivo móvil Iphone 3G, teléfonos Android e incluso a nuestro<a title="Continuar leyendo..." href="http://www.tutsnt.com/ejemplo-de-geolocalizacion-con-html5-y-google-maps/"> continuar &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Existen muchas técnicas para localizar un dispositivo a través de Internet, anteriormente para obtener la ubicación se necesitaba saber la dirección IP del cliente . Actualmente gracias  a la W3C que ha incluido en HTML5 un conjunto de APIS que permiten a cualquier dispositivo móvil Iphone 3G, teléfonos Android e incluso a nuestro ordenador de escritorio; a través de JavaScript recuperar información de su posición en el mapa, hoy en día la mayoría de navegadores tienen soporte para <strong>geolocalización</strong>.</p>
<p>Estos son algunos navegadores soportados:</p>
<ul>
<li><span><span>Firefox 3.5 +: Sí</span></span></li>
<li><span><span>Google Chrome 6 +: Sí</span></span></li>
<li><span><span>iPhone Safari: Sí</span></span></li>
<li><span><span>Opera 10 +: Sí</span></span></li>
<li><span><span>Safari: Si</span></span></li>
<li><span><span>Internet Explorer 9 + : Si<br />
</span></span></li>
</ul>
<p>En este tutorial haré un simple ejemplo el cual mostrará la <strong>Latitud</strong>, <strong>Altitud</strong> donde estamos ubicados y ademas mostrar la posición en el mapa usando la API de Google MAPS.</p>
<p><a href="http://www.tutsnt.com/wp-content/uploads/2011/10/Localizacion-HTML5.png"><img class="aligncenter" title="Localizacion-HTML5" src="http://www.tutsnt.com/wp-content/uploads/2011/10/Localizacion-HTML5.png" alt="Localizacion-HTML5" width="393" height="475" /></a></p>
<p>Para comenzar hay que crear nuestro diseño en HTML5.</p>
<pre class="brush: xhtml; gutter: true">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Posicionamiento con HTML , JavaScript y Google Maps&lt;/title&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js?ver=3.1.2'&gt;&lt;/script&gt;
	&lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?&amp;sensor=true"&gt;&lt;/script&gt;
	&lt;style type="text/css"&gt;
		html, body {
		height: 100%;
		margin: 0;
		padding: 0;
		}

		#mapa_content {
			height: 100%;
		}

		@media print {
			html, body {
			height: auto;
		}

		#mapa_content {
			height: 650px;
		}
	&lt;/style&gt;

	&lt;script type="text/javascript"&gt;
//Aquí va nuestro código
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="mapa_content"&gt;&lt;/div&gt; &lt;!-- Div contenedor del mapa --&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Ahora hay que programar  las APIS que nos da HTML5 Y Google Maps</p>
<ul>
<li><strong>inicializar()  - </strong>Se encargará de detectar si el navegador soporta Geolocalización luego crear una nueva instancia del objeto de Google Maps</li>
</ul>
<div>
<pre class="brush: javascript; gutter: true">      function inicializar() {
			var opciones = {
			  zoom: 6,
			  mapTypeId: google.maps.MapTypeId.ROADMAP
			};
			mapa = new google.maps.Map(document.getElementById('mapa_content'), opciones);
			if (navigator.geolocation)
			{
			    //Hago el CallBack a mostrarLocalizacion
				navigator.geolocation.getCurrentPosition(mostrarLocalizacion,manejadorDeError);
			}
			else{
			    //Caso contraio muestro error
				alert("Su navegador no soporta Geolocalizacion");
				}
		}</pre>
</div>
<ul>
<li><strong>mostrarLocalizacion(posicion) &#8211; </strong>Graficará en un <em>div</em> el mapa y su respectivo punto de nuestra posición.</li>
</ul>
<div>
<pre class="brush: javascript; gutter: true">      function mostrarLocalizacion(posicion)
	     {
            var pos = new google.maps.LatLng(posicion.coords.latitude,posicion.coords.longitude);
            //Muestro un tooltip con un mensaje sobre el mapa
            var infowindow = new google.maps.InfoWindow({
              map: mapa,
              position: pos,
              content: 'Tu ubicacion usando HTML5.'
            });

            mapa.setCenter(pos);
	      }</pre>
</div>
<ul>
<li><strong>manejadorDeError(error) &#8211; </strong>Encarga de controlar todos los posibles errores que re presente en el caso.</li>
</ul>
<div>
<pre class="brush: javascript; gutter: true">    function manejadorDeError(error) {

	switch(error.code)
             {
                case error.PERMISSION_DENIED: alert("El usuario no permite compartir datos de geolocalizacion");
                break;

                case error.POSITION_UNAVAILABLE: alert("Imposible detectar la posicio actual");
                break;

                case error.TIMEOUT: alert("La posicion debe recuperar el tiempo de espera");
                break;

                default: alert("Error desconocido");
                break;
              }
	      var opciones = {
			 map: mapa,
			  position: new google.maps.LatLng(60, 105),
			  content: content
		 };
		var infowindow = new google.maps.InfoWindow(opciones);
		mapa.setCenter(opciones.position);
      }</pre>
</div>
<div>El código final quedaría de la siguiente manera:</div>
<div>
<pre class="brush: javascript; gutter: true">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Posicionamiento con HTML , JavaScript y Google Maps&lt;/title&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js?ver=3.1.2'&gt;&lt;/script&gt;
	&lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?&amp;sensor=true"&gt;&lt;/script&gt;
	&lt;style type="text/css"&gt;
		html, body {
		height: 100%;
		margin: 0;
		padding: 0;
		}
		#mapa_content {
			height: 100%;
		}
		@media print {
			html, body {
			height: auto;
		}
		#mapa_content {
			height: 650px;
		}
	&lt;/style&gt;
	&lt;script type="text/javascript"&gt; 

		var mapa;

		function inicializar() {
			var opciones = {
			  zoom: 6,
			  mapTypeId: google.maps.MapTypeId.ROADMAP
			};
			mapa = new google.maps.Map(document.getElementById('mapa_content'), opciones);
			if (navigator.geolocation)
			{
			    //Hago el CallBack a mostrarLocalizacion
				navigator.geolocation.getCurrentPosition(mostrarLocalizacion,manejadorDeError);
			}
			else{
			    //Caso contraio muestro error
				alert("Su navegador no soporta Geolocalizacion");
				}
		}

	    function mostrarLocalizacion(posicion)
	     {
            var pos = new google.maps.LatLng(posicion.coords.latitude,posicion.coords.longitude);
            //Muestro un tooltip con un mensaje sobre el mapa
            var infowindow = new google.maps.InfoWindow({
              map: mapa,
              position: pos,
              content: 'Tu ubicacion usando HTML5.'
            });

            mapa.setCenter(pos);
	      }

	    function manejadorDeError(error) {

		   switch(error.code)
            {
                case error.PERMISSION_DENIED: alert("El usuario no permite compartir datos de geolocalizacion");
                break;

                case error.POSITION_UNAVAILABLE: alert("Imposible detectar la posicio actual");
                break;

                case error.TIMEOUT: alert("La posicion debe recuperar el tiempo de espera");
                break;

                default: alert("Error desconocido");
                break;
            }
			var opciones = {
			  map: mapa,
			  position: new google.maps.LatLng(60, 105),
			  content: content
			};
			var infowindow = new google.maps.InfoWindow(opciones);
			mapa.setCenter(opciones.position);
      }
      google.maps.event.addDomListener(window, 'load', inicializar);
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="mapa_content"&gt;&lt;/div&gt;  &lt;!-- Div contenedor del mapa --&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>
</div>
<div>Pueden una demostración del ejemplo :</div>
<div>
<ul>
<li><a href="http://www.tutsnt.com/wp-content/uploads/2011/10/geo2.html">Gelocalizacion HTML5</a></li>
</ul>
</div>
<div>Hay mucha información sobre este tema la W3C en el siguiente link:</div>
<div>
<ul>
<li><a href="http://www.w3.org/TR/geolocation-API/">http://www.w3.org/TR/geolocation-API/</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tutsnt.com/ejemplo-de-geolocalizacion-con-html5-y-google-maps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>