<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Tavarez's Home at davidtavarez.com &#187; Ajax</title>
	<atom:link href="http://www.davidtavarez.com/archives/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidtavarez.com</link>
	<description>Just another weblog...</description>
	<lastBuildDate>Sat, 31 Jul 2010 16:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Simple Modal Div for Images, using prototype and scriptaculous</title>
		<link>http://www.davidtavarez.com/archives/simple-modal-div-for-images-using-prototype-and-scriptaculous/</link>
		<comments>http://www.davidtavarez.com/archives/simple-modal-div-for-images-using-prototype-and-scriptaculous/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 18:14:35 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.davidtavarez.com/?p=350</guid>
		<description><![CDATA[I know that everyone knows Lightbox JS and Lightbox JS 2 and frankly those 2 libraries works very nice. But let's do something simplier using (also) prototype and scriptaculous. Aligning vertically and horizontallya div. This is very important and we can use it in many ways. First the css code: &#160;&#60;style type=&#34;text/css&#34;&#62;body, html &#123;height: 100%; [...]]]></description>
			<content:encoded><![CDATA[<p>I know that everyone knows <a title="Lightbox Js" href="http://www.huddletogether.com/projects/lightbox/" onclick="urchinTracker('/outgoing/www.huddletogether.com/projects/lightbox/?referer=');">Lightbox JS</a> and <a title="Lightbox 2" href="http://www.lokeshdhakar.com/projects/lightbox2/" onclick="urchinTracker('/outgoing/www.lokeshdhakar.com/projects/lightbox2/?referer=');">Lightbox JS 2</a> and frankly those 2 libraries works very nice. But let's do something simplier using (also) prototype and scriptaculous.</p>
<div id="result_box" style="text-align: left;" dir="ltr"><strong>Aligning vertically and horizontallya div.</strong></div>
<div style="text-align: left;" dir="ltr"></div>
<div style="text-align: left;" dir="ltr">This is very important and we can use it in many ways. First the css code:</div>
<pre class="css"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;style type=<span style="color: #ff0000;">&quot;text/css&quot;</span>&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">body, html <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;"><span style="color: #933;">100</span>%</span>; width<span style="color: #3333ff;">:<span style="color: #933;">100</span></span>%; <span style="color: #000000; font-weight: bold;">margin</span>: <span style="color: #933;">0</span>; <span style="color: #000000; font-weight: bold;">z-index</span>: <span style="color: #933;">-1</span>;<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#outer</span> <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;"><span style="color: #933;">90</span>%</span>; <span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #933;"><span style="color: #933;">90</span>%</span>; <span style="color: #000000; font-weight: bold;">overflow</span>: <span style="color: #993333;">hidden</span>; <span style="color: #000000; font-weight: bold;">position</span>: <span style="color: #993333;">fixed</span>; <span style="color: #000000; font-weight: bold;">top</span>: <span style="color: #933;"><span style="color: #933;">0</span>%</span>; <span style="color: #000000; font-weight: bold;">left</span>: <span style="color: #933;"><span style="color: #933;">0</span>%</span>; <span style="color: #000000; font-weight: bold;">right</span>: <span style="color: #933;"><span style="color: #933;">0</span>%</span>; <span style="color: #000000; font-weight: bold;">bottom</span>: <span style="color: #933;"><span style="color: #933;">0</span>%</span>; <span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #933;"><span style="color: #933;">100</span>%</span>; <span style="color: #000000; font-weight: bold;">z-index</span>: <span style="color: #933;">999</span>;<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#outer</span><span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span>: table; <span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#middle</span> <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">position</span>: <span style="color: #993333;">absolute</span>; <span style="color: #000000; font-weight: bold;">top</span>: <span style="color: #933;"><span style="color: #933;">50</span>%</span>; <span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #933;"><span style="color: #933;">100</span>%</span>; <span style="color: #000000; font-weight: bold;">text-align</span>: <span style="color: #993333;">center</span>;<span style="color: #66cc66;">&#125;</span> <span style="color: #808080; font-style: italic;">/* for explorer only*/</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#middle</span><span style="color: #66cc66;">&#91;</span>id<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span>: <span style="color: #993333;">table-cell</span>; <span style="color: #000000; font-weight: bold;">vertical-align</span>: <span style="color: #993333;">middle</span>; <span style="color: #000000; font-weight: bold;">position</span>: <span style="color: #993333;">static</span>;<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#inner</span> <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">position</span>: <span style="color: #993333;">relative</span>; <span style="color: #000000; font-weight: bold;">top</span>: -<span style="color: #933;"><span style="color: #933;">50</span>%</span>; <span style="color: #000000; font-weight: bold;">text-align</span>: <span style="color: #000000; font-weight: bold;">left</span>;<span style="color: #66cc66;">&#125;</span> <span style="color: #808080; font-style: italic;">/* for explorer only */</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#inner</span> <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-left</span>: <span style="color: #993333;">auto</span>; <span style="color: #000000; font-weight: bold;">margin-right</span>: <span style="color: #993333;">auto</span>;<span style="color: #66cc66;">&#125;</span> <span style="color: #808080; font-style: italic;">/* for all browsers*/</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* optional: #inner[id] {position: static;} */</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* just format */</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">div<span style="color: #6666ff;">.grayBorder</span> <span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">border</span>: <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span>; <span style="color: #000000; font-weight: bold;">background-color</span>: ivory;<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/style&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p>Now, we need the html code:</p>
<pre class="html4strict"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/div.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;outer&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;display: none;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/div.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;middle&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/div.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;inner&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;grayBorder&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">					any text<span style="color: #009900;"><a href="http://december.com/html/4/element/br.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/br.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;br</span></a>/<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">					<span style="color: #009900;"><a href="http://december.com/html/4/element/b.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/b.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;b&gt;</span></a></span>any height, set width,<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/b&gt;</span></span><span style="color: #009900;"><a href="http://december.com/html/4/element/br.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/br.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;br</span></a>/<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">					any content, for example generated from DB everything is both vertically and horizontally centered</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p>We use "display" as "none" because we won't display this div.</p>
<p>Now, "the magic", the javacript code:</p>
<pre class="javascript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span>&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #003366; font-weight: bold;">var</span> imagenes = $$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'img.SimpleImageModal'</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			imagenes.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #006600;">setAttribute</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'onclick'</span>,<span style="color: #3366CC;">'mostrarImagen(<span style="color: #000099; font-weight: bold;">\'</span>'</span>+<span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #006600;">src</span>+<span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\'</span>)'</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/script&gt;</div></li></ol></pre>
<p>We need to put this code at the end.</p>
<p>The final step is use a common class name for the <img/> tag, someting like this:</p>
<pre class="html4strict"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/div.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;imagenes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><a href="http://december.com/html/4/element/img.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/img.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;img</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;SimpleImageModal&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;images/25331-night4.jpg&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;160&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;120&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;Imagen Uno&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Imagen Uno&quot;</span>/<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><a href="http://december.com/html/4/element/img.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/img.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;img</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;SimpleImageModal&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;images/37590-greenz2.jpg&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;160&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;120&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;Imagen Dos&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Imagen Dos&quot;</span>/<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><a href="http://december.com/html/4/element/img.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/img.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;img</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;SimpleImageModal&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;images/treesmistblank.jpg&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;256&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;192&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;Imagen Tres&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Imagen Tres&quot;</span>/<span style="color: #000000; font-weight: bold;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p>And that's it!! Take a look to the complete example working here: <a href="http://demo.dwstudioinc.net/simpleimagemodal/" onclick="urchinTracker('/outgoing/demo.dwstudioinc.net/simpleimagemodal/?referer=');">SimpleImageModal Demo</a>.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/simple-modal-div-for-images-using-prototype-and-scriptaculous/" target="_blank" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/simple-modal-div-for-images-using-prototype-and-scriptaculous/&amp;referer=');"><img src="http://www.davidtavarez.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/simple-modal-div-for-images-using-prototype-and-scriptaculous/" target="_blank" title="Share on Facebook" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/simple-modal-div-for-images-using-prototype-and-scriptaculous/&amp;referer=');">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.davidtavarez.com/archives/simple-modal-div-for-images-using-prototype-and-scriptaculous/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Powerful tools for manipulating images using javascript</title>
		<link>http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/</link>
		<comments>http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 18:33:31 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.davidtavarez.com/?p=247</guid>
		<description><![CDATA[Surfing on Internet for a while, I found a wonderful toolbox. These are a compilation of several script to manipulate images. This is the list: busy.js: The library allows you to add/remove loading indicators to block-level elements on your webpages. shiftzoom.js: Allows you to add/remove zoom and pan functionality to oversized images on your webpages. [...]]]></description>
			<content:encoded><![CDATA[<p>Surfing on Internet for a while, I found a wonderful toolbox. These are a compilation of several script to manipulate images. This is the list:</p>
<p><a title="busy.js" href="http://busy.netzgesta.de/" onclick="urchinTracker('/outgoing/busy.netzgesta.de/?referer=');">busy.js</a>: The library allows you to add/remove loading indicators to block-level elements on your webpages.</p>
<p><a title="busy.js" href="http://shiftzoom.netzgesta.de/" onclick="urchinTracker('/outgoing/shiftzoom.netzgesta.de/?referer=');">shiftzoom.js</a>: Allows you to add/remove zoom and pan functionality to oversized images on your webpages.</p>
<p><a title="busy.js" href="http://sphere.netzgesta.de/" onclick="urchinTracker('/outgoing/sphere.netzgesta.de/?referer=');">sphere.js</a>: Simulates a spherical image effect.</p>
<p><a title="busy.js" href="http://corner.netzgesta.de/" onclick="urchinTracker('/outgoing/corner.netzgesta.de/?referer=');">corner.js</a>: The script allows you to add individual corners, shadings and shadows to images on your webpages.</p>
<p><a title="busy.js" href="http://glossy.netzgesta.de/" onclick="urchinTracker('/outgoing/glossy.netzgesta.de/?referer=');">glossy.js:</a> Simulates a glossy shaded and beveled button look.</p>
<p><a title="busy.js" href="http://instant.netzgesta.de/" onclick="urchinTracker('/outgoing/instant.netzgesta.de/?referer=');">instant.js</a>: Simulates an instant picture look including tilt.</p>
<p><a title="busy.js" href="http://bevel.netzgesta.de/" onclick="urchinTracker('/outgoing/bevel.netzgesta.de/?referer=');">bevel.js</a>: This script allows you to add bevels with individual glowing, shading and shining to images on your webpages.</p>
<p><a title="busy.js" href="http://slided.netzgesta.de/" onclick="urchinTracker('/outgoing/slided.netzgesta.de/?referer=');">slided.js</a>: This script allows you to add individual colors, shadings and shadows to images on your webpages.</p>
<p><a title="busy.js" href="http://filmed.netzgesta.de/" onclick="urchinTracker('/outgoing/filmed.netzgesta.de/?referer=');">filmed.js</a>: Simulates a film strip look including reflection.</p>
<p><a title="busy.js" href="http://mapper.netzgesta.de/" onclick="urchinTracker('/outgoing/mapper.netzgesta.de/?referer=');">mapper.js</a>: Emulates native area highlighting.</p>
<p><a title="busy.js" href="http://curl.netzgesta.de/" onclick="urchinTracker('/outgoing/curl.netzgesta.de/?referer=');">curl.js</a>: Simulates a page curl image effect.</p>
<p><a title="busy.js" href="http://edge.netzgesta.de/" onclick="urchinTracker('/outgoing/edge.netzgesta.de/?referer=');">edge.js</a>: This script allows you to add individual masks (inc. inbuilt mask) to images on your webpages.</p>
<p><a title="busy.js" href="http://reflex.netzgesta.de/" onclick="urchinTracker('/outgoing/reflex.netzgesta.de/?referer=');">reflex.js</a>: Allows you to add individual borders, tiltings and reflections to images on your webpages.</p>
<p><a title="busy.js" href="http://loupe.netzgesta.de/" onclick="urchinTracker('/outgoing/loupe.netzgesta.de/?referer=');">loupe.js</a>: This script allows you to add a loupe for magnifying (inc. start viewpoint) to an image on your webpage.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/" target="_blank" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/&amp;referer=');"><img src="http://www.davidtavarez.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/" target="_blank" title="Share on Facebook" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/&amp;referer=');">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.davidtavarez.com/archives/powerful-tools-for-manipulating-images-using-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Limit textarea length using javascript</title>
		<link>http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/</link>
		<comments>http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 20:31:50 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.davidtavarez.com/?p=142</guid>
		<description><![CDATA[This is a simple code, but useful. First, the javascript function: function limit&#40;n,id&#41;&#123; // n is the number of max characters // id is the id of the textarea element text = document.getElementById&#40;id&#41;; if&#40;text.value.length &#38;gt;= n&#41;&#123; //alert(&#34;sorry, the text is too long&#34;); text.value = text.value.substring&#40;0, n-1&#41;; &#125; &#125; Then, the html implementation: &#60;textarea id=&#34;textoalimitar&#34; onkeypress=&#34;limit(10,'textoalimitar');&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple code, but useful.</p>
<p>First, the javascript function:</p>
<pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> limit<span style="color: #66cc66;">&#40;</span>n,id<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
        <span style="color: #009900; font-style: italic;">// n is the number of max characters</span>
        <span style="color: #009900; font-style: italic;">// id is the id of the textarea element</span>
	text = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>text.<span style="color: #006600;">value</span>.<span style="color: #006600;">length</span> &amp;gt;= n<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #009900; font-style: italic;">//alert(&quot;sorry, the text is too long&quot;);</span>
		text.<span style="color: #006600;">value</span> = text.<span style="color: #006600;">value</span>.<span style="color: #006600;">substring</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">0</span>, n<span style="color: #CC0000;">-1</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>Then, the html implementation:</p>
<pre class="html4strict"><span style="color: #009900;"><a href="http://december.com/html/4/element/textarea.html" onclick="urchinTracker('/outgoing/december.com/html/4/element/textarea.html?referer=');"><span style="color: #000000; font-weight: bold;">&lt;textarea</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;textoalimitar&quot;</span>
<span style="color: #000066;">onkeypress</span>=<span style="color: #ff0000;">&quot;limit(10,'textoalimitar');&quot;</span> <span style="color: #000066;">cols</span>=<span style="color: #ff0000;">&quot;45&quot;</span> <span style="color: #000066;">rows</span>=<span style="color: #ff0000;">&quot;5&quot;</span>
 <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;textoalimitar&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/textarea&gt;</span></span></pre>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/" target="_blank" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/limit-textarea-length-using-javascript/&amp;referer=');"><img src="http://www.davidtavarez.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/" target="_blank" title="Share on Facebook" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/limit-textarea-length-using-javascript/&amp;referer=');">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.davidtavarez.com/archives/limit-textarea-length-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Language API (AJAX)</title>
		<link>http://www.davidtavarez.com/archives/google-language-ajax-api/</link>
		<comments>http://www.davidtavarez.com/archives/google-language-ajax-api/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 08:10:24 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.davidtavarez.com/?p=81</guid>
		<description><![CDATA[On last march Google and their AJAX Search and Feeds team launched the Language API. This new API boasts two functions, language translation and language detection. Maybe the the most important function of this API is the Translation. Is very easy to use it. To see more information about this API and learn how to [...]]]></description>
			<content:encoded><![CDATA[<p>On last march Google and their AJAX Search and Feeds team launched the Language API. This new API boasts two functions, language translation and language detection. Maybe the the most important function of this API is the Translation. Is very easy to use it.</p>
<p>To see more information about this API and learn how to use it, please click here <a href="http://googleajaxsearchapi.blogspot.com/2008/03/introducing-ajax-language-api-tools-for.html" onclick="urchinTracker('/outgoing/googleajaxsearchapi.blogspot.com/2008/03/introducing-ajax-language-api-tools-for.html?referer=');">Google AJAX Search API Blog: Introducing the AJAX Language API - Tools for Translation and Language Detection</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/google-language-ajax-api/" target="_blank" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/google-language-ajax-api/&amp;referer=');"><img src="http://www.davidtavarez.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.davidtavarez.com/archives/google-language-ajax-api/" target="_blank" title="Share on Facebook" onclick="urchinTracker('/outgoing/www.facebook.com/share.php?u=http_//www.davidtavarez.com/archives/google-language-ajax-api/&amp;referer=');">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.davidtavarez.com/archives/google-language-ajax-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
