<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Linea de Codigo</title>
	
	<link>http://lineadecodigo.com</link>
	<description>/* Programación en la red */</description>
	<lastBuildDate>Wed, 16 May 2012 06:00:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/LineaDeCodigo" /><feedburner:info uri="lineadecodigo" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Poner música en tu web con HTML5</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/9kSvPpoyRNg/</link>
		<comments>http://lineadecodigo.com/html5/poner-musica-en-tu-web-con-html5/#comments</comments>
		<pubDate>Wed, 16 May 2012 06:00:52 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[acc]]></category>
		<category><![CDATA[advanced audio coding]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[controls]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[mpeg-1]]></category>
		<category><![CDATA[Ogg]]></category>
		<category><![CDATA[vorbis]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4311</guid>
		<description><![CDATA[Una de las cosas que ya está estandarizada en HTML5 es la reproducción de elementos de audio. Es decir, podemos poder música en la web de una forma estándar. Para poder poner música en las webs, HTML5 ha estandarizado el elemento AUDIO. Así que, lo que tendremos que hacer, para poner un archivo de música [...]]]></description>
			<content:encoded><![CDATA[<p>Una de las cosas que ya está estandarizada en <a href="http://www.manualweb.net/tutorial-html5/" title="Tutorial de HTML5">HTML5</a> es la reproducción de elementos de audio. Es decir, podemos poder música en la web de una forma estándar.</p>
<p>Para poder poner música en las webs, <a href="http://www.manualweb.net/tutorial-html5/" title="Tutorial de HTML5">HTML5</a> ha estandarizado el elemento <a href="http://www.w3api.com/wiki/HTML5:AUDIO" title="Elemento AUDIO de HTML5">AUDIO</a>. Así que, lo que tendremos que hacer, para poner un archivo de música será insertar la siguiente etiqueta:</p>
<pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;audio <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cancion&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>audio&gt;</span></pre>
<p>Por lo tanto, si nuestra canción es "micancion.mp3" el código a utilizar será:</p>
<pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;audio <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;micancion.mp3&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>audio&gt;</span></pre>
<p>Si escribimos solamente este código no llegaremos muy lejos ya que, por defecto, el elemento de audio no se muestra. Por lo tanto no podremos utilizar los botones de play, stop, pause,... Así, si queremos que el elemento de <a href="http://www.w3api.com/wiki/HTML5:AUDIO" title="Elemento AUDIO de HTML5">AUDIO</a venga con un reproductor deberemos de añadir el autributo <a href="http://www.w3api.com/wiki/HTML5:AUDIO.controls" title="Atributo controls del elemento AUDIO de HTML5">controls</a>.</p>
<pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;audio <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;micancion.mp3&quot;</span> controls&gt;&lt;<span style="color: #66cc66;">/</span>audio&gt;</span></pre>
<p>Así ya tendremos el reproductor que nos permita poner la música en nuestra web con <a href="http://www.manualweb.net/tutorial-html5/" title="Tutorial de HTML5">HTML5</a.</p>
<p>Los formatos que podemos reproducir mediante el elemento <a href="http://www.w3api.com/wiki/HTML5:AUDIO" title="Elemento AUDIO de HTML5">AUDIO</a> de <a href="http://www.manualweb.net/tutorial-html5/" title="Tutorial de HTML5">HTML5</a son:</p>
<ul>
<li><strong>MPEG-1 audio layer 3</strong>, que son los más que de sobra conocidos como MP3 y extensión .mp3.</li>
<li><strong>Advanced Audio Coding</strong>, mejoraban la calidad de sonido de los MP3 y es un formato promovido por Apple. Su extensión es .acc. Este formato funciona bajo pantentes</li>
<li><strong>Vorbis</strong>, o conocido como Ogg Vorbis. Es un formato libre de patentes. La extensión que utilizan es .ogg</li>
</ul>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/html/embed-musica-de-fondo-en-tu-pagina-web/" rel="bookmark" title="Marzo 24, 2007">Embed: Música de fondo en tu página web</a></li>
<li><a href="http://lineadecodigo.com/java/reproducir-musica-por-java/" rel="bookmark" title="Abril 24, 2010">Reproducir música por java</a></li>
<li><a href="http://lineadecodigo.com/html5/iniciar-automaticamente-un-video-en-html5/" rel="bookmark" title="Enero 16, 2012">Iniciar automáticamente un vídeo en HTML5</a></li>
<li><a href="http://lineadecodigo.com/html/cargar-un-video-avi-asf-o-wmv-en-mi-pagina-web/" rel="bookmark" title="Agosto 29, 2007">Cargar un vídeo AVI, ASF o WMV en mi página web</a></li>
<li><a href="http://lineadecodigo.com/html/utilizando-la-etiqueta-address/" rel="bookmark" title="Septiembre 8, 2010">Utilizando la etiqueta ADDRESS</a></li>
</ul>
<p><!-- Similar Posts took 9.005 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/QHshufBSbn13gqRN3Z9vawxqXjc/0/da"><img src="http://feedads.g.doubleclick.net/~a/QHshufBSbn13gqRN3Z9vawxqXjc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/QHshufBSbn13gqRN3Z9vawxqXjc/1/da"><img src="http://feedads.g.doubleclick.net/~a/QHshufBSbn13gqRN3Z9vawxqXjc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=9kSvPpoyRNg:SHyKfSBmggo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=9kSvPpoyRNg:SHyKfSBmggo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=9kSvPpoyRNg:SHyKfSBmggo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=9kSvPpoyRNg:SHyKfSBmggo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=9kSvPpoyRNg:SHyKfSBmggo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=9kSvPpoyRNg:SHyKfSBmggo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=9kSvPpoyRNg:SHyKfSBmggo:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/9kSvPpoyRNg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/html5/poner-musica-en-tu-web-con-html5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/html5/poner-musica-en-tu-web-con-html5/</feedburner:origLink></item>
		<item>
		<title>Listas anidadas con jQuery Mobile</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/XgGnc7TB_Jo/</link>
		<comments>http://lineadecodigo.com/desarrollo-movil/listas-anidadas-con-jquery-mobile/#comments</comments>
		<pubDate>Mon, 14 May 2012 17:52:02 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Desarrollo Móvil]]></category>
		<category><![CDATA[addBackBtn]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[H3]]></category>
		<category><![CDATA[jquery mobile]]></category>
		<category><![CDATA[listas]]></category>
		<category><![CDATA[listas anidadas]]></category>
		<category><![CDATA[mobileinit]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4303</guid>
		<description><![CDATA[Ya vimos como hacer una lista simple de elementos y algunos atributos data para modificar esta lista con jQuery Mobile. En este caso vamos a ver como podemos crear listas anidadas. Es decir una lista que, cuando seleccionemos una opción, nos muestre subopciones de dicha opción. Algo claro si pensamos en ciudades/regiones/países. En nuestro caso [...]]]></description>
			<content:encoded><![CDATA[<p>Ya vimos como hacer una lista simple de elementos y algunos atributos data para modificar esta lista con <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a>.</p>
<p>En este caso vamos a ver como podemos crear listas anidadas. Es decir una lista que, cuando seleccionemos una opción, nos muestre subopciones de dicha opción. Algo claro si pensamos en ciudades/regiones/países.</p>
<p>En nuestro caso vamos a utilizar ciudades y comunidades autónomas de España. Algo que quedaría de la siguiente forma:</p>
<p><img src="http://img.aulambra.com/wp-content/uploads/2012/05/ListasAnidadas.png" alt="" title="ListasAnidadas" width="448" height="314" class="aligncenter size-full wp-image-4305" /></p>
<p>Para crear listas anidadas con <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a> solo tenemos que seguir la implementación que haríamos directamente en <a href="http://www.manualweb.net/tutorial-html/" title="Manual de HTML">HTML</a>. Ya que será el formateador de <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a> quien se encargue de realizar la anidación de la lista.</p>
<p>Así el código quedaría de la siguiente forma:</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;listview&quot;</span> data-inset<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> data-filter<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:H3"><span style="color: #000000; font-weight: bold;">h3</span></a>&gt;</span>Castilla y León<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:H3"><span style="color: #000000; font-weight: bold;">h3</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Avila<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Burgos<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>León<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Palencia<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Salamanca<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Segovia<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Soria<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Valladolid<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Zamora<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:H3"><span style="color: #000000; font-weight: bold;">h3</span></a>&gt;</span>Extremadura<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:H3"><span style="color: #000000; font-weight: bold;">h3</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Badajoz<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Caceres<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
&nbsp;</pre>
<p>Un punto importante para el formato que utiliza <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a> es que el elemento de la lista superior lo maquetemos mediante un elemento <a href="http://www.w3api.com/wiki/HTML:H3" title="Elemento H3 de HTML">H3</a>.</p>
<p>Este simple código nos ayuda a tener listas anidadas con <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a>. Pero podemos añadir alguna cosa y es que al entrar en la lista anidada perdemos la referencia a la lista padre. Y es por ello que vamos a insertar un elemento back en la cabecera de la lista anidada.</p>
<p>Para esto nos vamos a apoyar en el API de <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a> y en concreto en el atributo <strong>$.mobile.page.prototype.options.addBackBtn</strong>. Y es que inicializando este atributo a true nos aparecerá el botón de back al entrar en la anidación de las listas.</p>
<p>Para configurarlo deberemos de hacerlo al arrancar el framework jQuery. Es en este momento cuando se lanza el evento mobileinit. Por lo cual nos vamos a suscribir a este evento mediante un método <a href="http://www.w3api.com/wiki/jQuery:Bind()" title="Método bind de jQuery">.bind()</a> para realizar la inicialización.</p>
<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mobileinit&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $.<span style="color: #660066;">mobile</span>.<span style="color: #660066;">page</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">options</span>.<span style="color: #660066;">addBackBtn</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
<p>Y ya tenemos el ejemplo de las listas anidadas con <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a> montado. Eso sí, una de las cosas que veremos es que se pierden las cabeceras header y footer de la lista inicial. ¿Alguien sabe como resolverlo?<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/desarrollo-movil/divisores-de-listas-con-jquery-mobile/" rel="bookmark" title="Mayo 11, 2012">Divisores de listas con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/listas-de-elementos-en-jquery-mobile/" rel="bookmark" title="Mayo 10, 2012">Listas de Elementos en jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/hola-mundo-con-jquery-mobile/" rel="bookmark" title="Mayo 9, 2012">Hola Mundo con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/javascript/crear-eventos-con-javascript/" rel="bookmark" title="Septiembre 29, 2007">Crear eventos con JavaScript</a></li>
<li><a href="http://lineadecodigo.com/jquery/numero-de-elementos-de-una-lista-con-jquery/" rel="bookmark" title="Enero 31, 2009">Número de elementos de una lista con jQuery</a></li>
</ul>
<p><!-- Similar Posts took 9.839 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/LiHNKwf3gPd5_LWIuo_NwFjL97w/0/da"><img src="http://feedads.g.doubleclick.net/~a/LiHNKwf3gPd5_LWIuo_NwFjL97w/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/LiHNKwf3gPd5_LWIuo_NwFjL97w/1/da"><img src="http://feedads.g.doubleclick.net/~a/LiHNKwf3gPd5_LWIuo_NwFjL97w/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=XgGnc7TB_Jo:Kfi8p7zmmic:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=XgGnc7TB_Jo:Kfi8p7zmmic:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=XgGnc7TB_Jo:Kfi8p7zmmic:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=XgGnc7TB_Jo:Kfi8p7zmmic:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=XgGnc7TB_Jo:Kfi8p7zmmic:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=XgGnc7TB_Jo:Kfi8p7zmmic:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=XgGnc7TB_Jo:Kfi8p7zmmic:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/XgGnc7TB_Jo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/desarrollo-movil/listas-anidadas-con-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/desarrollo-movil/listas-anidadas-con-jquery-mobile/</feedburner:origLink></item>
		<item>
		<title>Conversaciones sobre Programación. Build 2012.02</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/7qG3DOqdcp8/</link>
		<comments>http://lineadecodigo.com/conversacion/conversaciones-sobre-programacion-build-2012-02/#comments</comments>
		<pubDate>Sun, 13 May 2012 21:34:14 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Conversación]]></category>
		<category><![CDATA[algoritmos]]></category>
		<category><![CDATA[anotaciones]]></category>
		<category><![CDATA[arquitectura]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[bases de datos]]></category>
		<category><![CDATA[certificación]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[e/r]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[favicon]]></category>
		<category><![CDATA[HTML Polyglot]]></category>
		<category><![CDATA[input file]]></category>
		<category><![CDATA[intercepts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jquery mobile]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[ManageBean]]></category>
		<category><![CDATA[método burbuja]]></category>
		<category><![CDATA[Microsoft SLQ Server]]></category>
		<category><![CDATA[modelos]]></category>
		<category><![CDATA[msdos]]></category>
		<category><![CDATA[número feliz]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[Pastebin]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[persitencia]]></category>
		<category><![CDATA[Phyton]]></category>
		<category><![CDATA[Scanner]]></category>
		<category><![CDATA[serie de taylor]]></category>
		<category><![CDATA[substances]]></category>
		<category><![CDATA[tablas]]></category>
		<category><![CDATA[tutoriales]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[w3c]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4284</guid>
		<description><![CDATA[Segunda entrega del resumen en los grupos de conversación de Facebook sobre lenguajes de programación en español. La verdad es que no dejo de estar sorprendido de la cantidad y calidad de las conversaciones en los grupos. Y muy agradecido de toda la gente que está participando en ellos. Esta semana hemos lanzado uno nuevo, el [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2023" style="margin: 10px;" title="logo_aulambra" src="http://img.aulambra.com/wp-content/uploads/2009/10/logo_aulambra.png" alt="" width="100" height="100" />Segunda entrega del resumen en los <strong><a title="Grupos de Conversación en Facebook sobre lenguajes de programación en español" href="http://lineadecodigo.com/conversacion/grupos-de-conversacion-sobre-programacion-en-facebook/">grupos de conversación de Facebook sobre lenguajes de programación en español</a>.</strong> La verdad es que no dejo de estar sorprendido de la cantidad y calidad de las conversaciones en los grupos. Y muy agradecido de toda la gente que está participando en ellos.</p>
<p>Esta semana hemos lanzado uno nuevo, <a title="Grupo de Conversación sobre Bases de Datos" href="http://lineadecodigo.com/conversacion/nuevo-grupo-de-conversacion-sobre-bases-de-datos/">el grupo de conversación sobre Bases de Datos</a>. Y así, de la nada, ya hay 100 miembros conversando. Una pasada.</p>
<p>Pero echemos un vistazo a las últimas conversaciones de los grupos sobre programación en español...</p>
<h3>HTML5 en Español<br />
<a href="https://www.facebook.com/groups/html5.es/">https://www.facebook.com/groups/html5.es/</a><br />
<em style="font-size: 0.7em;">106 miembros (+31)</em></h3>
<ul>
<li><a title="Documento HTML Polyglot" href="https://www.facebook.com/groups/html5.es/permalink/196944440426427/">Documento de trabajo HTML Polyglot</a>, o lo que quiere hacer la <a href="http://www.w3.org">W3C</a> para que los documentos sean multi-idioma.</li>
<li>Un artículo que habla de las <a title="7 tecnologías que sostienen Facebook" href="https://www.facebook.com/groups/html5.es/permalink/197072073746997/">7 tecnologías que sostienen Facebook</a>, de los chicos de <a title="Genbeta" href="http://www.genbeta.com/">Genbeta</a>.</li>
<li>Pregunta sobre <a title="Poner un favicon en una página web" href="https://www.facebook.com/groups/html5.es/permalink/198296236957914/">cómo poner el Favicon en una página web</a>.</li>
<li>¿Alguién conoce un <a title="Hosting con soporte Phyton con Django" href="https://www.facebook.com/groups/html5.es/permalink/199156506871887/">hosting con soporte de Phyton con Django</a>?</li>
<li>Dudas sobre <a title="Cómo subir un fichero con un INPUT file y Perl" href="https://www.facebook.com/groups/html5.es/permalink/200923810028490/">cómo subir un fichero con un input file y el lenguaje Perl</a>.</li>
</ul>
<div>Además se están manteniendo varios documentos:</div>
<div>
<ul>
<li><a title="Test para probar HTMl5" href="https://www.facebook.com/groups/html5.es/doc/152308228223382/">Test para probar HTML5</a></li>
<li><a title="Herramientas para desarrollar en HTML5" href="https://www.facebook.com/groups/html5.es/doc/152306054890266/">Herramientas para desarrollar con HTML5</a></li>
</ul>
</div>
<h3>Java en Español<br />
<a href="https://www.facebook.com/groups/java.es/">https://www.facebook.com/groups/java.es/</a><br />
<em style="font-size: 0.7em;">156 miembros (+66)</em></h3>
<p>Lo más importante es que hemos <a title="¿Qué IDE utilizarias para empezar a aprender Java?" href="http://lineadecodigo.com/conversacion/con-que-ide-empezarias-a-aprender-java/">lanzando una encuesta sobre qué IDE utilizarías para empezar a aprender el lenguaje de Java</a>. No dejes de contestar y añadir tus comentarios.</p>
<ul>
<li><a title="Método de ordenación burbuja para arrays" href="https://www.facebook.com/groups/java.es/doc/414873981869857/">Cómo resolver el método de ordenación de Arrays con el método burbuja</a></li>
<li><a title="Páginas con Tutoriales para empezar con Java" href="https://www.facebook.com/groups/java.es/permalink/414870695203519/">Páginas con tutoriales para empezar con Java</a> (y <a title="Páginas con Tutoriales para empezar con Java" href="https://www.facebook.com/groups/java.es/permalink/420347981322457/">2</a>)</li>
<li>Se pedía <a title="Ayuda para el algoritmo de un Número Feliz" href="https://www.facebook.com/groups/java.es/permalink/415979385092650/">ayuda sobre cómo resolver el algoritmo del Número Feliz</a>.... y <a title="Número Feliz con Java" href="https://www.facebook.com/groups/java.es/permalink/416369071720348/">ya está resuelto y publicado</a>.</li>
<li>Se ha <a title="Calcular la Serie de Taylor en Java" href="https://www.facebook.com/groups/java.es/permalink/415849171772338/">comentado y resuelto como construir un programa para calcular la serie de Taylor</a>.</li>
<li>Ayuda para encontrar <a title="Información y Ejemplo de la Anotación @intercepts" href="https://www.facebook.com/groups/java.es/permalink/417771101580145/">información y ejemplo de la anotación @Intercepts</a>.</li>
<li><em><a title="Pablo Ruiz" href="http://lineadecodigo.com/author/pablo-ruiz/">Pablo Ruiz</a></em> está publicando artículos muy interesantes con los <a title="Ejercicios de la Certificación Java" href="https://www.facebook.com/groups/java.es/permalink/418420224848566/">ejercicios de la Certificación Java</a> en <a title="Blog de Pablo Ruiz" href="https://www.facebook.com/groups/java.es/permalink/419639228059999/">su blog</a>.</li>
<li>¿<a title="Sirven los tutoriales de Eclipse para Netbeans" href="https://www.facebook.com/groups/java.es/permalink/418328488191073/">Sirven los tutoriales de Eclipse para Netbeans</a>?</li>
<li><a title="Primeros Pasos de JSF" href="https://www.facebook.com/groups/java.es/permalink/418627111494544/">Primeros pasos de JSF</a>, <a title="Primera pantalla con JSF" href="https://www.facebook.com/groups/java.es/permalink/418730241484231/">Primera pantalla con JSF</a> y <a title="Manejando ManageBean en JSF" href="https://www.facebook.com/groups/java.es/permalink/418914368132485/">Manejando ManageBean en JSF</a> por <em>Julio Pari.</em></li>
<li><em>Ing Guillermo Gonzalez</em> propone ir publicando <a title="Algoritmos Básicos para la gente que Empieza" href="https://www.facebook.com/groups/java.es/permalink/419425571414698/">algoritmos básicos e irles resolviendo para ayudar a la gente que empieza</a>. (y <a title="Ayuda con Algoritmos para novatos con Java" href="https://www.facebook.com/groups/java.es/permalink/420596044630984/">2</a>)</li>
<li><a title="Material de Certificación Java" href="https://www.facebook.com/groups/java.es/permalink/419621021395153/">¿Quieres material de certificación Java?</a>... Ya se ha publicado <a title="Ejemplos de Certificación Java" href="https://www.facebook.com/groups/java.es/permalink/419627108061211/">algunos ejemplos</a>.</li>
<li>Un poco de <a title="Ayuda en un código de manejo de Scanner" href="https://www.facebook.com/groups/java.es/permalink/419740344716554/">ayuda en un código con el manejo de Scanner</a>.</li>
<li><a title="Ayuda con Java Server Faces" href="https://www.facebook.com/groups/java.es/permalink/419770264713562/">Ayuda con Java Server Faces</a>.</li>
<li><a title="Arquitectura para construir una aplicación web" href="https://www.facebook.com/groups/java.es/permalink/419699408053981/">¿Qué arquitectura seguir para construir una aplicación web?</a></li>
<li><a title="Pastebin, aplicación para compartir código web" href="https://www.facebook.com/groups/java.es/permalink/419940944696494/">Pastebin</a> una buena aplicación para compartir código fuente.</li>
<li><a title="Blog de Algoritmos y Cia" href="https://www.facebook.com/groups/java.es/permalink/420002518023670/">Algoritmos y cia</a>, un buen blog para compartir algoritmos básicos.</li>
<li>Ayuda para declarar un <a title="Array para insertar cualquier tipo de objeto" href="https://www.facebook.com/groups/java.es/permalink/419926398031282/">array dónde puedas  insertar cualquier tipo de objeto</a>.</li>
<li><a title="Crear ventanas personalizadas con Susbtances" href="https://www.facebook.com/groups/java.es/permalink/420148648009057/">Crear ventanas personalizadas con Substances</a></li>
<li>Aunque no te lo creas, <a title="Emulador de MSDOS" href="https://www.facebook.com/groups/java.es/permalink/420355854655003/">se busca un emulador de MSDOS</a>.</li>
<li>Cómo <a title="Separar un número de dígitos" href="https://www.facebook.com/groups/java.es/permalink/420132684677320/">separar a un número en dígitos</a>.</li>
<li><a title="Modelos de Persistencia que no sean de consultas" href="https://www.facebook.com/groups/java.es/permalink/420279081329347/">Capas de persistencia de datos que no sean el típico manejo de sentencias de un modelo E/R</a>.</li>
</ul>
<h3>Javascript en Español<br />
<a href="https://www.facebook.com/groups/javascript.es/">https://www.facebook.com/groups/javascript.es/</a><br />
<em style="font-size: 0.7em;">84 miembros (+18)</em></h3>
<ul>
<li>Una <a title="Chuleta con ayudas para Javascript" href="https://www.facebook.com/groups/javascript.es/permalink/387491987956252/">chuleta sobre Javascript</a>, bastante interesante.</li>
</ul>
<h3>jQuery en Español<br />
<a href="https://www.facebook.com/groups/jquery.es/">https://www.facebook.com/groups/jquery.es/</a><br />
<em style="font-size: 0.7em;">99 miembros (+17)</em></h3>
<ul>
<li><a title="Hola Mundo con jQuery Mobile" href="https://www.facebook.com/groups/jquery.es/permalink/230596510384339/">El Hola Mundo con jQuery Mobile</a></li>
</ul>
<h3>PHP en Español<br />
<a href="https://www.facebook.com/groups/HypertextPreprocessor.es/">https://www.facebook.com/groups/HypertextPreprocessor.es/</a><br />
<em style="font-size: 0.7em;">89 miembros (+26)</em></h3>
<ul>
<li>Un <a title="Vídeo sobre la gente de Linux" href="https://www.facebook.com/groups/HypertextPreprocessor.es/permalink/340508512681153/">vídeo sobre la gente de Linux</a>.</li>
<li>El <a title="Framework Codeigniter" href="https://www.facebook.com/groups/HypertextPreprocessor.es/permalink/341810909217580/">framework CodeIgniter</a>.</li>
<li>Ayuda a Raúl para montar el <a title="Consultas para mostrar listado de libros" href="https://www.facebook.com/groups/HypertextPreprocessor.es/permalink/343588932373111/">código que consulta una base de datos y muestra un listado de libros</a>. (y <a title="Ayuda para sacar un Listado de Libros" href="https://www.facebook.com/groups/HypertextPreprocessor.es/permalink/343710989027572/">2</a>)</li>
<li>¿<a title="Configurar el PHP en Aptana" href="https://www.facebook.com/groups/HypertextPreprocessor.es/permalink/344776318921039/">Cómo configurar el PHP en Aptana</a>?</li>
<li><a title="Programación Orientada a Aspectos en PHP" href="https://www.facebook.com/groups/HypertextPreprocessor.es/permalink/345096205555717/">Programación Orientada a Aspectos en PHP</a></li>
<li>Problemas con <a title="Problemas con localhost y Drupal" href="https://www.facebook.com/groups/HypertextPreprocessor.es/permalink/344130968985574/">el localhost y Drupal</a>.</li>
<li><a title="Algunas novedades de lo que encontramos en PHP 5.4.0" href="https://www.facebook.com/groups/HypertextPreprocessor.es/permalink/345497462182258/">Algunas novedades de lo que encontramos en PHP 5.4.0</a></li>
</ul>
<h3>Bases de Datos en Español<br />
<a title="Bases de Datos en Español" href="https://www.facebook.com/groups/basesdedatos.es/">https://www.facebook.com/groups/basesdedatos.es/</a><br />
<em style="font-size: 0.7em;">100 miembros</em></h3>
<p>Una gran acogida del grupo sobre bases de datos en español con una cifra de 100 usuarios desde el inicio.</p>
<ul>
<li><a title="Mejor forma de extraer datos de una BD" href="https://www.facebook.com/groups/basesdedatos.es/permalink/356412641088816/">¿Cual es la mejor forma de extraer datos de una base de datos?</a></li>
<li>Algunas <a title="Tablas para practicar con Oracle" href="https://www.facebook.com/groups/basesdedatos.es/permalink/356382191091861/">tablas para practicar con Oracle</a> por <em><span style="text-decoration: underline;"><a title="Pablo Ruiz" href="http://lineadecodigo.com/author/pablo-ruiz/">Pablo Ruiz</a></span></em></li>
<li>Ayuda para <a title="Manejar links e imagenes en una base de datos" href="https://www.facebook.com/groups/basesdedatos.es/permalink/358160824247331/">manejar links e imágenes en una base de datos</a><em>.</em></li>
<li><a title="Descargar Microsoft SQL Server" href="https://www.facebook.com/groups/basesdedatos.es/permalink/358114370918643/">Dónde encontrar Microsft SQL Server</a><em>.</em></li>
<li>Como <a title="Empezar con los modelos y las bases de datos" href="https://www.facebook.com/groups/basesdedatos.es/permalink/358144370915643/">empezar en el mundo de los modelos y las bases de datos</a>.</li>
</ul>
<p>&nbsp;<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/conversacion/nuevo-grupo-de-conversacion-sobre-bases-de-datos/" rel="bookmark" title="Mayo 7, 2012">Nuevo grupo de conversación sobre Bases de Datos</a></li>
<li><a href="http://lineadecodigo.com/conversacion/conversaciones-sobre-programacion-build-2012-01/" rel="bookmark" title="Mayo 3, 2012">Conversaciones sobre Programación. Build 2012.01</a></li>
<li><a href="http://lineadecodigo.com/conversacion/grupos-de-conversacion-sobre-programacion-en-facebook/" rel="bookmark" title="Marzo 30, 2012">Grupos de Conversación sobre Programación en Facebook</a></li>
<li><a href="http://lineadecodigo.com/javascript/jssql-un-motor-de-base-de-datos-en-javascript/" rel="bookmark" title="Octubre 14, 2010">JSSQL: Un motor de base de datos en javascript</a></li>
<li><a href="http://lineadecodigo.com/eventos/java-intro-programming-bootcamp-3rd-session/" rel="bookmark" title="Enero 13, 2007">Java Intro Programming Bootcamp &#8211; 3rd session</a></li>
</ul>
<p><!-- Similar Posts took 14.055 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/0F6O9Utord4F5Z35nc7lN_0o_E4/0/da"><img src="http://feedads.g.doubleclick.net/~a/0F6O9Utord4F5Z35nc7lN_0o_E4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/0F6O9Utord4F5Z35nc7lN_0o_E4/1/da"><img src="http://feedads.g.doubleclick.net/~a/0F6O9Utord4F5Z35nc7lN_0o_E4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=7qG3DOqdcp8:G52v8jHD0wo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=7qG3DOqdcp8:G52v8jHD0wo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=7qG3DOqdcp8:G52v8jHD0wo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=7qG3DOqdcp8:G52v8jHD0wo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=7qG3DOqdcp8:G52v8jHD0wo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=7qG3DOqdcp8:G52v8jHD0wo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=7qG3DOqdcp8:G52v8jHD0wo:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/7qG3DOqdcp8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/conversacion/conversaciones-sobre-programacion-build-2012-02/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/conversacion/conversaciones-sobre-programacion-build-2012-02/</feedburner:origLink></item>
		<item>
		<title>Detectar la rotación del dispositivo con jQuery Mobile</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/Cibkx2I7juA/</link>
		<comments>http://lineadecodigo.com/desarrollo-movil/detectar-la-rotacion-del-dispositivo-con-jquery-mobile/#comments</comments>
		<pubDate>Sun, 13 May 2012 18:00:28 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Desarrollo Móvil]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[cambiar]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[event.orientation]]></category>
		<category><![CDATA[jquery mobile]]></category>
		<category><![CDATA[landscape]]></category>
		<category><![CDATA[orientationchange]]></category>
		<category><![CDATA[portrait]]></category>
		<category><![CDATA[rotación]]></category>
		<category><![CDATA[trigger]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4270</guid>
		<description><![CDATA[Una de las capacidades de los dispositivos móviles, ya sean smartphones o tablets, es que podemos girar el dispositivo y visualizar el contenido en dos posiciones. Las dos posiciones son conocidas como landscape (apaisado u horizontal) y portrait (retrato o vertical). Cuando estamos contruyendo nuestra aplicación para dispositivos móviles es interesante el conocer cuándo el [...]]]></description>
			<content:encoded><![CDATA[<p>Una de las capacidades de los dispositivos móviles, ya sean smartphones o tablets, es que podemos girar el dispositivo y visualizar el contenido en dos posiciones.</p>
<p>Las dos posiciones son conocidas como <strong>landscape</strong> (apaisado u horizontal) y <strong>portrait</strong> (retrato o vertical).</p>
<p><img src="http://img.aulambra.com/wp-content/uploads/2012/05/portrait-landscape.png" alt="" title="portrait-landscape" width="539" height="333" class="aligncenter size-full wp-image-4278" /></p>
<p>Cuando estamos contruyendo nuestra aplicación para dispositivos móviles es interesante el conocer cuándo el usuario ha decidido rotar el dispositivo. Ya que puede ser que necesitemos reajustar algo en la visualización de nuestra página.</p>
<p>Es por ello que <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a> nos proporciona un mecanismo para detectar la rotación del dispositivo. Este mecanismo es un evento, <strong>el evento orientationchange</strong>. Entonces lo que tenemos que hacer es escuchar al evento orientationchange y asignar una función para cuando se produzca dicho evento. Esto lo conseguimos mediante el método <a href="http://www.w3api.com/wiki/jQuery:Bind()" title="Método bind de jQuery">.bind()</a>.</p>
<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;orientationchange&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>...<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
<p>Dentro de la información del evento nos viene la orientación en la que el usuario ha puesto al dispositivo. En concreto viene en <strong>event.orientation</strong>. Los valores de event.orientation son "landscape" y "portrait".</p>
<p>Así, lo que haremos será, si viene el valor de event.orientation, asignaremos ese valor al contenido de una capa que hemos añadido en el contenido de la página</p>
<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;orientationchange&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<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>event.<span style="color: #660066;">orientation</span><span style="color: #009900;">&#41;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#contenido&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Me han reorientado a &quot;</span> <span style="color: #339933;">+</span> event.<span style="color: #660066;">orientation</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>
<p>La capa sería:</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
  Ejemplo que controla la rotaci<span style="color: #ddbb00;">&amp;oacute;</span>n del dispositivo movil.
  <span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SPAN"><span style="color: #000000; font-weight: bold;">span</span></a> <a href="http://w3api.com/wiki/HTML:id"><span style="color: #000066;">id</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;contenido&quot;</span>&gt;</span>Inicio de la Aplicación<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SPAN"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
&nbsp;</pre>
<p>Para la gestión del evento deberemos de esperar a que se haya cargado todo el contenido de la página. Es por ello que pondremos el código de gestión del evento para detectar la rotación del dispositivo dentro del evento <a href="http://www.w3api.com/wiki/jQuery:Ready()" title="Méotdo ready de jQuery">.ready()</a> de <a href="http://www.manualweb.net/tutorial-jquery/" title="Tutorial de jQuery">jQuery</a>.</p>
<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;orientationchange&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<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>event.<span style="color: #660066;">orientation</span><span style="color: #009900;">&#41;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#contenido&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Me han reorientado a &quot;</span> <span style="color: #339933;">+</span> event.<span style="color: #660066;">orientation</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>
<p>Por último deberemos de hacer es lanzar, por nosotros mismos, el evento orientationchange para que se calcule la orientación inicial del dispositivo. Pera esto nos apoyamos en el método <a href="http://www.w3api.com/wiki/jQuery:Trigger()" title="Método trigger de jQuery">.trigger()</a>.</p>
<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">trigger</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;orientationchange&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/jquery/evitar-que-se-ejecute-un-evento-con-jquery/" rel="bookmark" title="Junio 11, 2010">Evitar que se ejecute un evento con jQuery</a></li>
<li><a href="http://lineadecodigo.com/jquery/modificar-el-contenido-de-una-capa-con-jquery/" rel="bookmark" title="Mayo 27, 2010">Modificar el contenido de una capa con jQuery</a></li>
<li><a href="http://lineadecodigo.com/jquery/cargar-contenido-con-el-scroll-usando-jquery/" rel="bookmark" title="Mayo 24, 2010">Cargar contenido con el scroll usando jQuery</a></li>
<li><a href="http://lineadecodigo.com/jquery/cambios-en-un-combo-con-jquery/" rel="bookmark" title="Mayo 17, 2011">Cambios en un combo con jQuery</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/listas-anidadas-con-jquery-mobile/" rel="bookmark" title="Mayo 14, 2012">Listas anidadas con jQuery Mobile</a></li>
</ul>
<p><!-- Similar Posts took 7.464 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/CDN4OCvO_y_-A3o7Jy3K5XuD81E/0/da"><img src="http://feedads.g.doubleclick.net/~a/CDN4OCvO_y_-A3o7Jy3K5XuD81E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CDN4OCvO_y_-A3o7Jy3K5XuD81E/1/da"><img src="http://feedads.g.doubleclick.net/~a/CDN4OCvO_y_-A3o7Jy3K5XuD81E/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=Cibkx2I7juA:nuGqk11Moaw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=Cibkx2I7juA:nuGqk11Moaw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=Cibkx2I7juA:nuGqk11Moaw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=Cibkx2I7juA:nuGqk11Moaw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=Cibkx2I7juA:nuGqk11Moaw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=Cibkx2I7juA:nuGqk11Moaw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=Cibkx2I7juA:nuGqk11Moaw:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/Cibkx2I7juA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/desarrollo-movil/detectar-la-rotacion-del-dispositivo-con-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/desarrollo-movil/detectar-la-rotacion-del-dispositivo-con-jquery-mobile/</feedburner:origLink></item>
		<item>
		<title>Divisores de listas con jQuery Mobile</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/o5R-JloDDrk/</link>
		<comments>http://lineadecodigo.com/desarrollo-movil/divisores-de-listas-con-jquery-mobile/#comments</comments>
		<pubDate>Fri, 11 May 2012 06:00:28 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Desarrollo Móvil]]></category>
		<category><![CDATA[data-filter]]></category>
		<category><![CDATA[data-inset]]></category>
		<category><![CDATA[data-role]]></category>
		<category><![CDATA[divisores]]></category>
		<category><![CDATA[jquery mobile]]></category>
		<category><![CDATA[list-divider]]></category>
		<category><![CDATA[lista]]></category>
		<category><![CDATA[listview]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4250</guid>
		<description><![CDATA[En el ejemplo Listas de Elementos en jQuery Mobile veíamos como construir una lista de elementos para un dispositivo móvil utilizando jQuery Mobile. Ahora vamos a ir un paso más allá y vamos a ver como añadir elementos divisores en las listas. Es decir, items que nos permitan separar elementos para su organización. Puede ser [...]]]></description>
			<content:encoded><![CDATA[<p>En el ejemplo <a href="http://lineadecodigo.com/desarrollo-movil/listas-de-elementos-en-jquery-mobile/" title="Listas de Elementos en jQuery Mobile">Listas de Elementos en jQuery Mobile</a> veíamos como construir una lista de elementos para un dispositivo móvil utilizando <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a>.</p>
<p>Ahora vamos a ir un paso más allá y vamos a ver como añadir elementos divisores en las listas. Es decir, items que nos permitan separar elementos para su organización. Puede ser una agrupación alfabética, geográfica, horaria,...</p>
<p>En nuestro caso vamos crear una lista de películas cuyos divisores sean alfabéticos.</p>
<pre>C
++ Casablanca
++ Charada
D
++ Dos hombres y un destino
++</pre>
<p>Lo primero que hacemos es cargar el framework jQuery Mobile</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LINK"><span style="color: #000000; font-weight: bold;">link</span></a> <a href="http://w3api.com/wiki/HTML:rel"><span style="color: #000066;">rel</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.mobile-1.1.0.min.css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a> <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery-1.7.1.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a> <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.mobile-1.1.0.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></pre>
<p>Y como vimos en el ejemplo <a href="http://lineadecodigo.com/desarrollo-movil/listas-de-elementos-en-jquery-mobile/" title="Listas de Elementos en jQuery Mobile">Listas de Elementos en jQuery Mobile</a> utilizamos un elemento UL con un atributo <strong>data-role="listview"</strong>.</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;listview&quot;</span> data-inset<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> data-filter<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Casablanca<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Charada<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Dos Hombres y Un Destino<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Espartaco<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>El Golpe<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>La Guerra de las Galaxias<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Granujas a todo ritmo<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
&nbsp;</pre>
<p>Además hemos añadido los atributos <strong>data-inset="true"</strong> y <strong>data-filter="true"</strong>  para que la lista salga enmarcada y para tener un filtro en la lista, respectivamente.</p>
<p>Ahora meteremos los divisores de listas. Los divisores de listas serán otros elementos LI. Si bien estos elementos para ser diferenciados del resto de elementos de la lista tendrán un atributo <strong>data-role="list-divider"</strong>. Quedándonos nuestro código <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a> de la siguiente forma:</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;listview&quot;</span> data-inset<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> data-filter<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;list-divider&quot;</span>&gt;</span>C<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Casablanca<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Charada<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;list-divider&quot;</span>&gt;</span>D<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Dos Hombres y Un Destino<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;list-divider&quot;</span>&gt;</span>E<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Espartaco<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;list-divider&quot;</span>&gt;</span>G<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>El Golpe<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>La Guerra de las Galaxias<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Granujas a todo ritmo<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:A"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
&nbsp;</pre>
<p>El nombre del item que utiliza el atributo <strong>data-role="list-divider"</strong> será el nombre que se utilice como elemento divisor.</p>
<p>El efecto conseguido con <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a> para crear divisores de lista será algo parecido a:</p>
<p><img src="http://img.aulambra.com/wp-content/uploads/2012/05/DivisoresDeListas.png" alt="" title="DivisoresDeListas" width="615" height="569" class="aligncenter size-full wp-image-4254" /><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/desarrollo-movil/listas-de-elementos-en-jquery-mobile/" rel="bookmark" title="Mayo 10, 2012">Listas de Elementos en jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/listas-anidadas-con-jquery-mobile/" rel="bookmark" title="Mayo 14, 2012">Listas anidadas con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/hola-mundo-con-jquery-mobile/" rel="bookmark" title="Mayo 9, 2012">Hola Mundo con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/java/listar-una-lista-en-java/" rel="bookmark" title="Enero 27, 2007">Listar una lista en Java</a></li>
<li><a href="http://lineadecodigo.com/css/imagenes-como-hitos-de-listas-con-css/" rel="bookmark" title="Octubre 8, 2007">Imágenes como hitos de listas con CSS</a></li>
</ul>
<p><!-- Similar Posts took 8.077 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/DNGZv6sTD4CX0idrRIgktVGWzSQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/DNGZv6sTD4CX0idrRIgktVGWzSQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/DNGZv6sTD4CX0idrRIgktVGWzSQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/DNGZv6sTD4CX0idrRIgktVGWzSQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=o5R-JloDDrk:J8-adxosFLw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=o5R-JloDDrk:J8-adxosFLw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=o5R-JloDDrk:J8-adxosFLw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=o5R-JloDDrk:J8-adxosFLw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=o5R-JloDDrk:J8-adxosFLw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=o5R-JloDDrk:J8-adxosFLw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=o5R-JloDDrk:J8-adxosFLw:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/o5R-JloDDrk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/desarrollo-movil/divisores-de-listas-con-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/desarrollo-movil/divisores-de-listas-con-jquery-mobile/</feedburner:origLink></item>
		<item>
		<title>Listas de Elementos en jQuery Mobile</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/qEN2JOkE01c/</link>
		<comments>http://lineadecodigo.com/desarrollo-movil/listas-de-elementos-en-jquery-mobile/#comments</comments>
		<pubDate>Thu, 10 May 2012 06:00:17 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Desarrollo Móvil]]></category>
		<category><![CDATA[data-filter]]></category>
		<category><![CDATA[data-inset]]></category>
		<category><![CDATA[data-role]]></category>
		<category><![CDATA[jquery mobile]]></category>
		<category><![CDATA[LI]]></category>
		<category><![CDATA[lista]]></category>
		<category><![CDATA[listview]]></category>
		<category><![CDATA[UL]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4233</guid>
		<description><![CDATA[jQuery Mobile nos ofrece una forma sencilla de adaptar nuestras listas a los dispositivos móviles. Y es que una lista de elementos para el diseño móvil se sigue maquetando con los elementos UL y LI. Es decir, que podríamos tener una lista tal y como esta: &#160; &#60;ul&#62; &#60;li&#62;Avila&#60;/li&#62; &#60;li&#62;Burgos&#60;/li&#62; &#60;li&#62;León&#60;/li&#62; &#60;li&#62;Palencia&#60;/li&#62; &#60;li&#62;Salamanca&#60;/li&#62; &#60;li&#62;Segovia&#60;/li&#62; &#60;li&#62;Soria&#60;/li&#62; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a> nos ofrece una forma sencilla de adaptar nuestras listas a los dispositivos móviles. Y es que una lista de elementos para el diseño móvil se sigue maquetando con los elementos <a href="http://www.w3api.com/wiki/HTML:UL" title="Elemento UL de HTML">UL</a> y <a href="http://www.w3api.com/wiki/HTML:LI" title="Elemento LI de HTML">LI</a>.</p>
<p>Es decir, que podríamos tener una lista tal y como esta:</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Avila<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Burgos<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>León<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Palencia<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Salamanca<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Segovia<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Soria<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Valladolid<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Zamora<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
&nbsp;</pre>
<p>Si bien <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a> nos proporciona una serie de características para maquetarla. La primera es la que le da la apariencia. Esta la conseguimos con un atributo data-role. En este caso con <strong>data-role="listview"</strong>.</p>
<p>Este atributo lo añadimos al elemento UL.</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;listview&quot;</span>&gt;</span>
  ...
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
&nbsp;</pre>
<p>Y conseguiremos el siguiente efecto de maquetación.</p>
<p><img src="http://img.aulambra.com/wp-content/uploads/2012/05/listaElementosjQueryMobile1.png" alt="" title="listaElementosjQueryMobile1" width="631" height="471" class="aligncenter size-full wp-image-4234" /></p>
<p>Lo que podemos apreciar en la imagen es que la lista no se diferencia de forma correcta del contenido de la página. Si queremos que la lista se diferencia del resto del contenido podemos añadirla un recuadro. Esto nos lo posibilita el atributo <strong>data-inset="true"</strong>.</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;listview&quot;</span> data-inset<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span>&gt;</span>
  ...
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
&nbsp;</pre>
<p><img src="http://img.aulambra.com/wp-content/uploads/2012/05/listaElementosjQueryMobile2.png" alt="" title="listaElementosjQueryMobile2" width="631" height="517" class="aligncenter size-full wp-image-4235" /></p>
<p>Por último podemos añadirle un filtro a nuestra lista. Y es que esto lo conseguimos de una forma sencilla con el atributo <strong>data-filter="true"</strong>. No solo añadiremos un filtro, si no que el filtro realiza el filtrado del contenido de la lista.</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;listview&quot;</span> data-inset<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;strong&quot;</span> data-filter<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span>&gt;</span>
  ...
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
&nbsp;</pre>
<p><img src="http://img.aulambra.com/wp-content/uploads/2012/05/listaElementosjQueryMobile3.png" alt="" title="listaElementosjQueryMobile3" width="627" height="301" class="aligncenter size-full wp-image-4236" /></p>
<p>EL código final de nuestra lista de elementos en <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Tutorial de jQuery Mobile">jQuery Mobile</a> quedaría de la siguiente forma:</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;listview&quot;</span> data-inset<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> data-filter<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Avila<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Burgos<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>León<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Palencia<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Salamanca<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Segovia<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Soria<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Valladolid<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>Zamora<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LI"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:UL"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span>
&nbsp;</pre>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/desarrollo-movil/listas-anidadas-con-jquery-mobile/" rel="bookmark" title="Mayo 14, 2012">Listas anidadas con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/divisores-de-listas-con-jquery-mobile/" rel="bookmark" title="Mayo 11, 2012">Divisores de listas con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/java/bucle-for-each-en-java/" rel="bookmark" title="Febrero 2, 2009">Bucle for-each en Java</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/hola-mundo-con-jquery-mobile/" rel="bookmark" title="Mayo 9, 2012">Hola Mundo con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/java/inicializar-un-array-en-java/" rel="bookmark" title="Junio 14, 2007">Inicializar un array en Java</a></li>
</ul>
<p><!-- Similar Posts took 8.451 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/u0xuwiMnrwj6K9ewxuRcNIcX-ac/0/da"><img src="http://feedads.g.doubleclick.net/~a/u0xuwiMnrwj6K9ewxuRcNIcX-ac/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/u0xuwiMnrwj6K9ewxuRcNIcX-ac/1/da"><img src="http://feedads.g.doubleclick.net/~a/u0xuwiMnrwj6K9ewxuRcNIcX-ac/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=qEN2JOkE01c:2gMBXbc9hgY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=qEN2JOkE01c:2gMBXbc9hgY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=qEN2JOkE01c:2gMBXbc9hgY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=qEN2JOkE01c:2gMBXbc9hgY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=qEN2JOkE01c:2gMBXbc9hgY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=qEN2JOkE01c:2gMBXbc9hgY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=qEN2JOkE01c:2gMBXbc9hgY:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/qEN2JOkE01c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/desarrollo-movil/listas-de-elementos-en-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/desarrollo-movil/listas-de-elementos-en-jquery-mobile/</feedburner:origLink></item>
		<item>
		<title>¿Con qué IDE empezarías a aprender Java?</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/VjsUzUDjhcE/</link>
		<comments>http://lineadecodigo.com/conversacion/con-que-ide-empezarias-a-aprender-java/#comments</comments>
		<pubDate>Wed, 09 May 2012 22:14:32 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Conversación]]></category>
		<category><![CDATA[BlueJ]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JCreator]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4228</guid>
		<description><![CDATA[Esta es la pregunta que formulábamos en el grupo de conversación de Java en Español. ¿Con qué IDE empezarías a aprender Java? Utilizarías un IDE más o menos completo como puede ser Eclipse o NetBeans Realizarías un aprendizaje más espartano con el JDK y un editor de texto o con un IDE más sencillo como [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2023" style="margin: 10px;" title="logo_aulambra" src="http://img.aulambra.com/wp-content/uploads/2009/10/logo_aulambra.png" alt="" width="100" height="100" />Esta es la pregunta que formulábamos en <a href="https://www.facebook.com/groups/java.es/" title="Grupo de Conversación sobre Java en Español">el grupo de conversación de Java en Español</a>. <strong>¿Con qué IDE empezarías a aprender Java?</strong></p>
<ul>
<li>Utilizarías un IDE más o menos completo como puede ser Eclipse o NetBeans</li>
<li>Realizarías un aprendizaje más espartano con el JDK y un editor de texto o con un IDE más sencillo como jCreator o BlueJ</li>
<li>¿Conoces algún IDE orientado directamente al aprendizaje?</li>
</ul>
<p>Puedes <a href="https://www.facebook.com/groups/java.es/permalink/418423288181593/" title="Contestar la encuesta sobre qué IDE empezarías a aprender Java">contestar la encuesta en el grupo de conversación de Java en Español</a>.</p>
<p>Publicaremos el resultado y las respuestas más adelante.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/conversacion/grupos-de-conversacion-sobre-programacion-en-facebook/" rel="bookmark" title="Marzo 30, 2012">Grupos de Conversación sobre Programación en Facebook</a></li>
<li><a href="http://lineadecodigo.com/conversacion/conversaciones-sobre-programacion-build-2012-02/" rel="bookmark" title="Mayo 13, 2012">Conversaciones sobre Programación. Build 2012.02</a></li>
<li><a href="http://lineadecodigo.com/conversacion/nuevo-grupo-de-conversacion-sobre-bases-de-datos/" rel="bookmark" title="Mayo 7, 2012">Nuevo grupo de conversación sobre Bases de Datos</a></li>
<li><a href="http://lineadecodigo.com/conversacion/conversaciones-sobre-programacion-build-2012-01/" rel="bookmark" title="Mayo 3, 2012">Conversaciones sobre Programación. Build 2012.01</a></li>
<li><a href="http://lineadecodigo.com/recursos/java-en-twitter/" rel="bookmark" title="Septiembre 1, 2011">@java en Twitter</a></li>
</ul>
<p><!-- Similar Posts took 7.828 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/vz6rhKxP8uitT5A2HA_p-_ln2ZU/0/da"><img src="http://feedads.g.doubleclick.net/~a/vz6rhKxP8uitT5A2HA_p-_ln2ZU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vz6rhKxP8uitT5A2HA_p-_ln2ZU/1/da"><img src="http://feedads.g.doubleclick.net/~a/vz6rhKxP8uitT5A2HA_p-_ln2ZU/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=VjsUzUDjhcE:bPsg0GGSEeo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=VjsUzUDjhcE:bPsg0GGSEeo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=VjsUzUDjhcE:bPsg0GGSEeo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=VjsUzUDjhcE:bPsg0GGSEeo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=VjsUzUDjhcE:bPsg0GGSEeo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=VjsUzUDjhcE:bPsg0GGSEeo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=VjsUzUDjhcE:bPsg0GGSEeo:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/VjsUzUDjhcE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/conversacion/con-que-ide-empezarias-a-aprender-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/conversacion/con-que-ide-empezarias-a-aprender-java/</feedburner:origLink></item>
		<item>
		<title>Hola Mundo con jQuery Mobile</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/HIXZSJrVEpI/</link>
		<comments>http://lineadecodigo.com/desarrollo-movil/hola-mundo-con-jquery-mobile/#comments</comments>
		<pubDate>Wed, 09 May 2012 06:00:44 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Desarrollo Móvil]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[data-role]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[jquery mobile]]></category>
		<category><![CDATA[page]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4169</guid>
		<description><![CDATA[jQuery Mobile es un framework que nos permite desarrollar aplicaciones móviles que se ejecuten en múltiples plataformas de una forma muy sencilla. jQuery Mobile está basado en el framework jQuery. Vamos a ir construyendo una serie de ejemplos para explicar cómo funciona jQuery Mobile y, como no, el primero de ellos tenía que ser el [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a> es un framework que nos permite desarrollar aplicaciones móviles que se ejecuten en múltiples plataformas de una forma muy sencilla. jQuery Mobile está basado en el framework <a href="http://www.manualweb.net/tutorial-jquery/" title="Manual de jQuery">jQuery</a>.</p>
<p>Vamos a ir construyendo una serie de ejemplos para explicar cómo funciona <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a> y, como no, el primero de ellos tenía que ser el Hola Mundo con <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a>.</p>
<p>Lo primero que tenemos que hacer es descargarnos el framework <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a>. Para ello deberemos de descargar 2 archivos:</p>
<ul>
<li>El framework Javascript. Que es el fichero <a href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.js">jquery.mobile-1.1.0.js</a></li>
<li>El tema de jQuery Mobile. Que es el fichero <a href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.css">jquery.mobile-1.1.0.css</a></li>
</ul>
<p>O bien su versión reducida para un entorno de producción:</p>
<ul>
<li><a href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js">jquery.mobile-1.1.0.min.js</a> (24KB)</li>
<li><a href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css">jquery.mobile-1.1.0.css</a> (7KB)</li>
</ul>
<p>Además vamos a necesitar el framework <a href="http://www.manualweb.net/tutorial-jquery/" title="Manual de jQuery">jQuery</a>, con el que puedes empezar mediante el <a href="http://lineadecodigo.com/jquery/hola-mundo-con-jquery/" title="Hola Mundo con jQuery">Hola Mundo con jQuery</a> o leyéndote <a href="http://lineadecodigo.com/jquery/" title="Ejemplos de Código de jQuery">todos los artículos de jQuery</a>. Es importante que sepas que se necesitan las versiones jQuery 1.6.4 o jQuery 1.7.1 para utilizarlo junto a <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a>.</p>
<p><a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a> nos permite construir página web, las cuales van a ser páginas <a href="http://www.manualweb.net/tutorial-html5/" title="Manual de HTML5">HTML5</a>. Ya que <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a> aprovecha los atributos data-* de <a href="http://www.manualweb.net/tutorial-html5/" title="Manual de HTML5">HTML5</a> para poder construir las aplicaciones de una forma estandar. Así, que al final lo que tenemos es una página web. Y lo más importante, <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a>, insertará el código necesario de una forma <strong>no intrusiva</strong>.</p>
<p>Lo primero que tenemos que hacer a la hora de definir nuestra página web es, como te puedes imaginar, instanciar las librerías que nos hemos descargado.</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LINK"><span style="color: #000000; font-weight: bold;">link</span></a> <a href="http://w3api.com/wiki/HTML:rel"><span style="color: #000066;">rel</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <a href="http://w3api.com/wiki/HTML:href"><span style="color: #000066;">href</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.mobile-1.1.0.min.css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a> <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery-1.7.1.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a> <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.mobile-1.1.0.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></pre>
<p>Una vez instanciadas las librerías vamos a ver como se estructura la página web para que pueda ser visualizada en un móvil. Es decir, vamos a ver qué atributos data-* tenemos que utilizar.</p>
<p>El primero será <strong>data-role="page"</strong>. Este atributo habrá que darselo a la estructura que nos defina lo que es la página. Es decir, vamos a crear un bloque DIV con dicho atributo. Dicho bloque representará la página.</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page&quot;</span>&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!-- Pagina de jQuery Mobile --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
&nbsp;</pre>
<p>Lo siguiente será poner el contenido. Es decir, nuestro Hola Mundo con <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a>. Para ello tenemos otro atributo. Es este caso es <strong>data-role="content"</strong>. Este atributo se lo damos a otro elemento de bloque, es decir, a otro DIV.</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
&nbsp;
Mi primera p<span style="color: #ddbb00;">&amp;aacute;</span>gina web con jQuery Mobile.
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
&nbsp;</pre>
<p>Aunque con esto podríamos tener "acabado" nuestro Hola Mundo con <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a> vamos a echar un vistazo a otros dos atributos. Estos serán los que nos van a servir para definir una cabecera y un pie de página. En este caso serán los atributos <strong>data-role="header"</strong> y <strong>data-role="footer"</strong> respectivamente. Y como te puedes imagina van a otros elementos de bloque.</p>
<p>Así que utilizando estos dos nuevos elementos, nuestro código final nos quedaría de la siguiente forma:</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:H1"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span>Hola Mundo en jQuery Mobile<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:H1"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
&nbsp;
Mi primera p<span style="color: #ddbb00;">&amp;aacute;</span>gina web con jQuery Mobile.
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> data-role<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;footer&quot;</span>&gt;</span>
&nbsp;
<span style="color: #ddbb00;">&amp;copy;</span>2012 - Linea de Codigo
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
&nbsp;</pre>
<p>Ya tenemos nuestro Hola Mundo con <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a>. Solo nos queda probarlo en alguna de las platafomas que soporta el framework <a href="http://www.manualweb.net/tutorial-jquery-mobile/" title="Manual de jQuery Mobile">jQuery Mobile</a>:</p>
<ul>
<li>iOS5 – iPhone e iPad</li>
<li>Android 2.2 y 2.3</li>
<li>Tabletas Android 3.x (Honeycomb)</li>
<li>Android 4.x (ICS)</li>
<li>Chrome para Android (beta)</li>
<li>BB Playbook 1-2</li>
<li>BB7</li>
<li>Nook Color/Tablet</li>
<li>Kindle Fire</li>
<li>Kindle 3</li>
</ul>
<p>O simplemente, abriendolo en el navegador. <img src='http://img.aulambra.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> <strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/desarrollo-movil/divisores-de-listas-con-jquery-mobile/" rel="bookmark" title="Mayo 11, 2012">Divisores de listas con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/listas-de-elementos-en-jquery-mobile/" rel="bookmark" title="Mayo 10, 2012">Listas de Elementos en jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/listas-anidadas-con-jquery-mobile/" rel="bookmark" title="Mayo 14, 2012">Listas anidadas con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/jquery/peticiones-ajax-con-jquery/" rel="bookmark" title="Enero 6, 2010">Peticiones AJAX con jQuery</a></li>
<li><a href="http://lineadecodigo.com/jquery/repaginar-con-jquery-y-ajax/" rel="bookmark" title="Febrero 1, 2010">Repaginar con jQuery y AJAX</a></li>
</ul>
<p><!-- Similar Posts took 8.084 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/TCl8ZyvHQRHg2F8_ZnBXYFRp4Y0/0/da"><img src="http://feedads.g.doubleclick.net/~a/TCl8ZyvHQRHg2F8_ZnBXYFRp4Y0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/TCl8ZyvHQRHg2F8_ZnBXYFRp4Y0/1/da"><img src="http://feedads.g.doubleclick.net/~a/TCl8ZyvHQRHg2F8_ZnBXYFRp4Y0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=HIXZSJrVEpI:0odlgczllWY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=HIXZSJrVEpI:0odlgczllWY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=HIXZSJrVEpI:0odlgczllWY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=HIXZSJrVEpI:0odlgczllWY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=HIXZSJrVEpI:0odlgczllWY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=HIXZSJrVEpI:0odlgczllWY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=HIXZSJrVEpI:0odlgczllWY:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/HIXZSJrVEpI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/desarrollo-movil/hola-mundo-con-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/desarrollo-movil/hola-mundo-con-jquery-mobile/</feedburner:origLink></item>
		<item>
		<title>Nuevo grupo de conversación sobre Bases de Datos</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/vjHZlY7O0gU/</link>
		<comments>http://lineadecodigo.com/conversacion/nuevo-grupo-de-conversacion-sobre-bases-de-datos/#comments</comments>
		<pubDate>Sun, 06 May 2012 22:36:57 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Conversación]]></category>
		<category><![CDATA[bases de datos]]></category>
		<category><![CDATA[bases de datos distribuidas]]></category>
		<category><![CDATA[bases de datos en memoria]]></category>
		<category><![CDATA[bigdata]]></category>
		<category><![CDATA[conversación]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[queries]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4170</guid>
		<description><![CDATA[A petición de la gente que está en los Grupos de Conversación sobre Programación en Español creamos un nuevo grupo dedicado al tema de las bases de datos. Así que si quieres hablar sobre Bases de Datos en Español de cosas como: Utilización de gestores de bases de datos MySQL, DB2, PostgreSQL, Oracle,... Uso de [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2023" style="margin: 10px;" title="logo_aulambra" src="http://img.aulambra.com/wp-content/uploads/2009/10/logo_aulambra.png" alt="" width="100" height="100" />A petición de la gente que está en <a title="Grupos de Conversación sobre Programación en Español" href="http://lineadecodigo.com/conversacion/grupos-de-conversacion-sobre-programacion-en-facebook/">los Grupos de Conversación sobre Programación en Español</a> creamos un nuevo grupo dedicado al tema de las bases de datos.<br />
Así que si quieres hablar sobre <strong>Bases de Datos en Español</strong> de cosas como:</p>
<ul>
<li>Utilización de gestores de bases de datos MySQL, DB2, PostgreSQL, Oracle,...</li>
<li>Uso de lenguajes de programación para utilizar las bases de datos</li>
<li>Manejo y mantenimiento de las bases de datos.</li>
<li>Optimización de Queries.</li>
<li>Bases de datos en Memoria</li>
<li>Bases de Datos Distribuidas</li>
<li>BigData</li>
<li>Uso de sistemas de persistencia como Hibernate.</li>
<li>...</li>
</ul>
<p>Si buscas algo de eso. Solo tienes que unirte a <a title="Grupo de Charla sobre Bases de Datos en Español" href="https://www.facebook.com/groups/basesdedatos.es/">https://www.facebook.com/groups/basesdedatos.es/</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/conversacion/conversaciones-sobre-programacion-build-2012-02/" rel="bookmark" title="Mayo 13, 2012">Conversaciones sobre Programación. Build 2012.02</a></li>
<li><a href="http://lineadecodigo.com/conversacion/conversaciones-sobre-programacion-build-2012-01/" rel="bookmark" title="Mayo 3, 2012">Conversaciones sobre Programación. Build 2012.01</a></li>
<li><a href="http://lineadecodigo.com/conversacion/grupos-de-conversacion-sobre-programacion-en-facebook/" rel="bookmark" title="Marzo 30, 2012">Grupos de Conversación sobre Programación en Facebook</a></li>
<li><a href="http://lineadecodigo.com/noticias-web/10-anos-de-xml/" rel="bookmark" title="Febrero 19, 2008">10 años de XML</a></li>
<li><a href="http://lineadecodigo.com/java/theserverside-java-symposium-europe/" rel="bookmark" title="Junio 10, 2007">TheServerSide Java Symposium-Europe</a></li>
</ul>
<p><!-- Similar Posts took 11.837 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/2-4GsIubO3P_btcUboLRjJ3mLlo/0/da"><img src="http://feedads.g.doubleclick.net/~a/2-4GsIubO3P_btcUboLRjJ3mLlo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/2-4GsIubO3P_btcUboLRjJ3mLlo/1/da"><img src="http://feedads.g.doubleclick.net/~a/2-4GsIubO3P_btcUboLRjJ3mLlo/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=vjHZlY7O0gU:-ybmRY80khs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=vjHZlY7O0gU:-ybmRY80khs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=vjHZlY7O0gU:-ybmRY80khs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=vjHZlY7O0gU:-ybmRY80khs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=vjHZlY7O0gU:-ybmRY80khs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=vjHZlY7O0gU:-ybmRY80khs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=vjHZlY7O0gU:-ybmRY80khs:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/vjHZlY7O0gU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/conversacion/nuevo-grupo-de-conversacion-sobre-bases-de-datos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/conversacion/nuevo-grupo-de-conversacion-sobre-bases-de-datos/</feedburner:origLink></item>
		<item>
		<title>Calcular el número feliz con Java</title>
		<link>http://feedproxy.google.com/~r/LineaDeCodigo/~3/RQT5DxhWRLo/</link>
		<comments>http://lineadecodigo.com/java/calcular-el-numero-feliz-con-java/#comments</comments>
		<pubDate>Sat, 05 May 2012 11:18:18 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[contains]]></category>
		<category><![CDATA[dígitos]]></category>
		<category><![CDATA[HashSet]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[número feliz]]></category>
		<category><![CDATA[numero]]></category>
		<category><![CDATA[pow]]></category>
		<category><![CDATA[Set]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=4160</guid>
		<description><![CDATA[Ayer hablábamos en el grupo de Facebook sobre Java en Español (¿¿Qué todavía no estás apuntado???) sobre el cálculo de el número feliz con Java. Pero, ¿qué es un número feliz? Si seguimos la descripción de la wikipedia sobre el número feliz, este es aquel que, de forma iterativa, en la suma de sus dígitos [...]]]></description>
			<content:encoded><![CDATA[<p>Ayer hablábamos en <a href="https://www.facebook.com/groups/java.es/" title="Grupo de Facebook en Español">el grupo de Facebook sobre Java en Español</a> (¿¿Qué todavía no estás apuntado???) sobre <a href="https://www.facebook.com/groups/java.es/permalink/415979385092650/" title="Charla sobre cómo calcular un número feliz en Java">el cálculo de el número feliz con Java</a>. Pero, ¿qué es un número feliz? Si seguimos <a href="http://es.wikipedia.org/wiki/N%C3%BAmero_feliz" title="Descripción del número feliz por la wikipedia">la descripción de la wikipedia sobre el número feliz</a>, este es aquel que, de forma iterativa, en la suma de sus dígitos acaba resultando un 1.</p>
<p>Es decir, para el caso del número 7, que es un número feliz, la secuencia sería la siguiente:</p>
<p>7<sup>2</sup> = 49<br />
4<sup>2</sup> + 9<sup>2</sup> = 97<br />
9<sup>2</sup> + 7<sup>2</sup> = 130<br />
1<sup>2</sup> + 3<sup>2</sup> + 0<sup>2</sup> = 10<br />
1<sup>2</sup> + 0<sup>2</sup> = 1</p>
<p>Así que nos ponemos manos a la obra para resolver este planteamiento de el número feliz con <a href="http://www.manualweb.net/tutorial-java/" title="Manual de Java">Java</a>. </p>
<p>Lo primero que vemos es que hay que extraer los dígitos del número. Esto ya lo explicábamos en <a href="http://lineadecodigo.com/java/digitos-de-un-numero/" title="Dígitos de un número">el artículo Dígitos de un número con Java</a>. Así que es bueno que lo leas en detalle. Si bien, lo que hacemos es utilizar divisiones y el módulo del 10 (división y resto) para ir extrayendo los números del dígito.</p>
<pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> digitosNumero<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> iNumero<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">// Creamos un array del tamaño del número de dígitos del número</span>
  <a href="http://w3api.com/wiki/Java:String"><span style="color: #aaaadd; font-weight: bold;">String</span></a> x = <a href="http://w3api.com/wiki/Java:Integer"><span style="color: #aaaadd; font-weight: bold;">Integer</span></a>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span>iNumero<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
  <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> iNumeros = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span>x.<span style="color: #006600;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">// Método que devuelve los dígitos de un número</span>
  <span style="color: #993333;">int</span> iDigito = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>
  <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>iNumero<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    iNumeros<span style="color: #66cc66;">&#91;</span>iDigito<span style="color: #66cc66;">&#93;</span> = iNumero<span style="color: #66cc66;">%</span>10<span style="color: #66cc66;">;</span>
    iNumero = iNumero/<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">;</span>
    iDigito++<span style="color: #66cc66;">;</span>
  <span style="color: #66cc66;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">return</span> iNumeros<span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre>
<p>Al final hemos construido un método que dado un entero nos devuelve un array con los dígitos de dicho número.</p>
<p>Lo siguiente será, por cada dígito del número hacer la suma de los cuadrados de los dígitos. Para calcular los cuadrados utilizamos el <a href="http://www.w3api.com/wiki/Java:Math.pow()" title="Método pow de la clase Math de Java">método .pow()</a> de la clase <a href="http://www.w3api.com/wiki/Java:Math" title="Clase Math de Java">Math</a>.</p>
<blockquote><p>Recuerda que la clase <a href="http://www.w3api.com/wiki/Java:Math" title="Clase Math de Java">Math</a> es estática y no hace falta instanciarla.</p></blockquote>
<p>El código de esta suma de dígitos al cuadrado sería:</p>
<pre class="java" style="font-family:monospace;"><span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> iNumeros = digitosNumero<span style="color: #66cc66;">&#40;</span>iNumero<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
iSuma = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> x=<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>x<span style="color: #66cc66;">&lt;</span>iNumeros.<span style="color: #006600;">length</span><span style="color: #66cc66;">;</span>x++<span style="color: #66cc66;">&#41;</span>
  iSuma += <a href="http://w3api.com/wiki/Java:Math"><span style="color: #aaaadd; font-weight: bold;">Math</span></a>.<span style="color: #006600;">pow</span><span style="color: #66cc66;">&#40;</span>iNumeros<span style="color: #66cc66;">&#91;</span>x<span style="color: #66cc66;">&#93;</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre>
<p>Ahora hay que validar si la suma es un uno o si no saldremos del bucle. En el caso de que no sea un uno volvemos a llamar a la función digitosNumero para que nos vuelva a "trocear" el nuevo número.</p>
<pre class="java" style="font-family:monospace;"><span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>iSuma<span style="color: #66cc66;">!</span>=<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  iSuma = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>		
&nbsp;
  <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> x=<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>x<span style="color: #66cc66;">&lt;</span>iNumeros.<span style="color: #006600;">length</span><span style="color: #66cc66;">;</span>x++<span style="color: #66cc66;">&#41;</span>
    iSuma += <a href="http://w3api.com/wiki/Java:Math"><span style="color: #aaaadd; font-weight: bold;">Math</span></a>.<span style="color: #006600;">pow</span><span style="color: #66cc66;">&#40;</span>iNumeros<span style="color: #66cc66;">&#91;</span>x<span style="color: #66cc66;">&#93;</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>				
&nbsp;
  iNumeros = digitosNumero<span style="color: #66cc66;">&#40;</span>iSuma<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>Con esto ya tendríamos nuestro código que calcule si un número es un número feliz con <a href="http://www.manualweb.net/tutorial-java/" title="Manual de Java">Java</a> terminado. Pero hay una cosa que se puede mejorar, y es que si el número no es feliz se mete en una secuencia infinita de calculos, ya que nunca encontrará el 1. Si bien, podemos cortar este bucle si se repite un número en la secuencia, ya que volverá a la misma secuencia.</p>
<p>Veamos el caso del número 2:</p>
<p>2<sup>2</sup> = 4<br />
4<sup>2</sup> = 16<br />
1<sup>2</sup> + 6<sup>2</sup> = 37<br />
3<sup>2</sup> + 7<sup>2</sup> = 58<br />
5<sup>2</sup> + 8<sup>2</sup> = 89<br />
8<sup>2</sup> + 9<sup>2</sup> = 145<br />
1<sup>2</sup> + 4<sup>2</sup> + 5<sup>2</sup> = 42<br />
4<sup>2</sup> + 2<sup>2</sup> = 20<br />
2<sup>2</sup> + 0<sup>2</sup> = 4</p>
<p>Al llegar al número 4 que ya estaba en la serie, todo se volverá a repetir de forma infinita. Es por ello que en este punto habría que cortar el cálculo.</p>
<p>Para implementar esto lo que hemos hecho es añadir un conjunto, es decir, un <a href="http://www.w3api.com/wiki/Java:Set" title="Clase Set de Java">Set</a> al programa, al cual vamos metiendo los números, siempre y cuando el número sumado no esté. Ya que si esta significará que la secuencia se vuelve a repetir y hay que salir del bucle.</p>
<p>Instanciamos el <a href="http://www.w3api.com/wiki/Java:Set" title="Clase Set de Java">Set</a> mediante una clase <a href="http://www.w3api.com/wiki/Java:HashSet" title="Clase HashSet de Java">HashSet</a>.</p>
<pre class="java" style="font-family:monospace;">Set<span style="color: #66cc66;">&lt;</span>Integer<span style="color: #66cc66;">&gt;</span> iCalculados = <span style="color: #000000; font-weight: bold;">new</span> HashSet<span style="color: #66cc66;">&lt;</span>Integer<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre>
<p>Y en mitad del bucle hacemos la comprobación o inserción en el conjunto. Para ello utilizamos los métodos <a href="http://www.w3api.com/wiki/Java:HashSet.contains()" title="Método contains de la clase HashSet de Java">.contains</a> y <a href="http://www.w3api.com/wiki/Java:HashSet.add()" title="Método add de la clase HashSet de Java">.add</a></p>
<pre class="java" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>iCalculados.<span style="color: #006600;">contains</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://w3api.com/wiki/Java:Integer"><span style="color: #aaaadd; font-weight: bold;">Integer</span></a><span style="color: #66cc66;">&#40;</span>iSuma<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  bRepetido = <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">;</span>
<span style="color: #b1b100;">else</span>
  iCalculados.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://w3api.com/wiki/Java:Integer"><span style="color: #aaaadd; font-weight: bold;">Integer</span></a><span style="color: #66cc66;">&#40;</span>iSuma<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre>
<p>Vemos que aparece una variable bRepetido y es que esta será el flag que utilicemos para salirnos del bucle. Así que finalmente nuestro bucle de cálculo quedará de la siguiente forma:</p>
<pre class="java" style="font-family:monospace;"><span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>iSuma<span style="color: #66cc66;">!</span>=<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #66cc66;">!</span><span style="color: #66cc66;">&#40;</span>bRepetido<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  iSuma = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>
  <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> x=<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>x<span style="color: #66cc66;">&lt;</span>iNumeros.<span style="color: #006600;">length</span><span style="color: #66cc66;">;</span>x++<span style="color: #66cc66;">&#41;</span>
    iSuma += <a href="http://w3api.com/wiki/Java:Math"><span style="color: #aaaadd; font-weight: bold;">Math</span></a>.<span style="color: #006600;">pow</span><span style="color: #66cc66;">&#40;</span>iNumeros<span style="color: #66cc66;">&#91;</span>x<span style="color: #66cc66;">&#93;</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
  iNumeros = digitosNumero<span style="color: #66cc66;">&#40;</span>iSuma<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">// Controlamos si ha salido un número repetido. Para no entrar en el bucle.</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>iCalculados.<span style="color: #006600;">contains</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://w3api.com/wiki/Java:Integer"><span style="color: #aaaadd; font-weight: bold;">Integer</span></a><span style="color: #66cc66;">&#40;</span>iSuma<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    bRepetido = <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">;</span>
  <span style="color: #b1b100;">else</span>
    iCalculados.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://w3api.com/wiki/Java:Integer"><span style="color: #aaaadd; font-weight: bold;">Integer</span></a><span style="color: #66cc66;">&#40;</span>iSuma<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
 <span style="color: #66cc66;">&#125;</span></pre>
<p>Ya solo nos quedará imprimir si el número es un número feliz o no. Esto nos lo cuenta la variable bRepetido. <img src='http://img.aulambra.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<pre class="java" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>bRepetido<span style="color: #66cc66;">&#41;</span>
  <a href="http://w3api.com/wiki/Java:System"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>iNumero + <span style="color: #ff0000;">&quot; NO es un número feliz&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #b1b100;">else</span>
  <a href="http://w3api.com/wiki/Java:System"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>iNumero + <span style="color: #ff0000;">&quot; SI es un número feliz&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/java/digitos-de-un-numero/" rel="bookmark" title="Mayo 18, 2011">Dígitos de un número</a></li>
<li><a href="http://lineadecodigo.com/java/validador-de-rut-en-java/" rel="bookmark" title="Diciembre 9, 2010">Validador de RUT en Java</a></li>
<li><a href="http://lineadecodigo.com/javascript/validar-un-cif-en-javascript/" rel="bookmark" title="Mayo 26, 2010">Validar un CIF en Javascript</a></li>
<li><a href="http://lineadecodigo.com/java/ultimo-digito-de-un-numero-con-java/" rel="bookmark" title="Enero 11, 2009">Último dígito de un número con Java</a></li>
<li><a href="http://lineadecodigo.com/java/mayor-de-dos-numeros/" rel="bookmark" title="Mayo 30, 2011">Mayor de dos números</a></li>
</ul>
<p><!-- Similar Posts took 8.428 ms --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/S2b-9pY07jdnMlUvX89lY_CubVc/0/da"><img src="http://feedads.g.doubleclick.net/~a/S2b-9pY07jdnMlUvX89lY_CubVc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/S2b-9pY07jdnMlUvX89lY_CubVc/1/da"><img src="http://feedads.g.doubleclick.net/~a/S2b-9pY07jdnMlUvX89lY_CubVc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=RQT5DxhWRLo:6brOWugtbSo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=RQT5DxhWRLo:6brOWugtbSo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=RQT5DxhWRLo:6brOWugtbSo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=RQT5DxhWRLo:6brOWugtbSo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?i=RQT5DxhWRLo:6brOWugtbSo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=RQT5DxhWRLo:6brOWugtbSo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LineaDeCodigo?a=RQT5DxhWRLo:6brOWugtbSo:tKBiNdHYW3c"><img src="http://feeds.feedburner.com/~ff/LineaDeCodigo?d=tKBiNdHYW3c" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LineaDeCodigo/~4/RQT5DxhWRLo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/java/calcular-el-numero-feliz-con-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://lineadecodigo.com/java/calcular-el-numero-feliz-con-java/</feedburner:origLink></item>
	</channel>
</rss><!-- Served from: lineadecodigo.com @ 2012-05-16 20:54:16 by W3 Total Cache -->

