<?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>The Code Dreamer : Nitin Hayaran &#187; Javascript</title>
	<atom:link href="http://www.nitinh.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nitinh.com</link>
	<description>Nitin Hayaran&#039;s Blog</description>
	<lastBuildDate>Sun, 29 Jan 2012 07:28:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How to Properly Hide and Show Elements Using Javascript</title>
		<link>http://www.nitinh.com/2011/05/how-to-properly-hide-and-show-elements-using-javascript/</link>
		<comments>http://www.nitinh.com/2011/05/how-to-properly-hide-and-show-elements-using-javascript/#comments</comments>
		<pubDate>Sun, 15 May 2011 14:50:09 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/?p=529</guid>
		<description><![CDATA[TweetShareWhat is the first solution comes to your mind, when someone asks you How can I dynamically hide any element using Javascript ? The obvious solutions to this is to set "display" style to "none". Something like this: document.getElementById&#40;'element'&#41;.style.display = 'none'; This will surely work, but is it the correct way to do so? May [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/' rel='bookmark' title='Permanent Link: Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools'>Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/06/energy-saving-javascript/' rel='bookmark' title='Permanent Link: Energy Saving Javascript'>Energy Saving Javascript</a></li>
<li><a href='http://www.nitinh.com/2009/10/show-imdb-ratings-on-torrentzcom-using-greasemonkey-script/' rel='bookmark' title='Permanent Link: Show IMDB Ratings on Torrentz.com using GreaseMonkey Script'>Show IMDB Ratings on Torrentz.com using GreaseMonkey Script</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2011/05/how-to-properly-hide-and-show-elements-using-javascript/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2011/05/how-to-properly-hide-and-show-elements-using-javascript/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><p>What is the first solution comes to your mind, when someone asks you</p>
<blockquote><p>How can I dynamically hide any element using Javascript ?</p></blockquote>
<p><span id="more-529"></span></p>
<p>The obvious solutions to this is to set "display" style to "none". Something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'element'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">;</span></pre></div></div>

<p>This will surely work, but is it the correct way to do so? May be not, as you would face problems in showing that element again. The problem in showing that element is that you don't know the original display property of that element. Whether it was a "Block" level element or an "inline" element. So, basically you'll have to do something like this, depending upon type of element:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'element'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'block'</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'element'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'inline'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Can we do it in some better way?</p>
<h3>Now do it proper way</h3>
<p>An improved way to achieve similar thing  is to create a css class like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">.<span style="color: #993333;">hide</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span> !important<span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>And now just add or remove this class to hide and show elements.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'element'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'hide'</span><span style="color: #339933;">;</span></pre></div></div>

<p>or write $("element").addClass('hide'); if you are using mootools.</p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/' rel='bookmark' title='Permanent Link: Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools'>Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/06/energy-saving-javascript/' rel='bookmark' title='Permanent Link: Energy Saving Javascript'>Energy Saving Javascript</a></li>
<li><a href='http://www.nitinh.com/2009/10/show-imdb-ratings-on-torrentzcom-using-greasemonkey-script/' rel='bookmark' title='Permanent Link: Show IMDB Ratings on Torrentz.com using GreaseMonkey Script'>Show IMDB Ratings on Torrentz.com using GreaseMonkey Script</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2011/05/how-to-properly-hide-and-show-elements-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Energy Saving Javascript</title>
		<link>http://www.nitinh.com/2010/06/energy-saving-javascript/</link>
		<comments>http://www.nitinh.com/2010/06/energy-saving-javascript/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 18:30:38 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[black]]></category>
		<category><![CDATA[black-screen]]></category>
		<category><![CDATA[Effect]]></category>
		<category><![CDATA[energy]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/?p=483</guid>
		<description><![CDATA[TweetShareTitle of this post may seem strange to you but this is true, You can actually save some energy by using this Javascript on your website. Let me tell you how. This javascript turns the webpage black if there is no user activity on the page for some time. As the page predominantly turn black [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/' rel='bookmark' title='Permanent Link: Beautiful Nag Screen using JQuery &amp; CSS3'>Beautiful Nag Screen using JQuery &amp; CSS3</a></li>
<li><a href='http://www.nitinh.com/2009/02/wtf-what-the-framework-bookmarklet-find-the-javascript-framework-being-used/' rel='bookmark' title='Permanent Link: WTF : What the Framework bookmarklet : Find the javascript framework being used'>WTF : What the Framework bookmarklet : Find the javascript framework being used</a></li>
<li><a href='http://www.nitinh.com/2009/02/dictionary-on-double-click-bookmarklet/' rel='bookmark' title='Permanent Link: Dictionary on double click : BookMarklet'>Dictionary on double click : BookMarklet</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2010/06/energy-saving-javascript/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2010/06/energy-saving-javascript/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><p><img class="size-full wp-image-485 alignleft" style="margin: 0 10px 10px 0;" title="Energy Saving Script" src="http://www.nitinh.com/wp-content/uploads/2010/06/black.jpg" alt="Energy Saving Script" width="191" height="191" />Title of this post may seem strange to you but this is true, You can actually save some energy by using this Javascript on your website. Let me tell you how.</p>
<p>This javascript turns the webpage black if there is no user activity on the page for some time. As the page predominantly turn black the script in-effect saves energy.</p>
<blockquote><p>Image displayed is primarily a function of the user's color settings and desktop graphics, as well as the color and size of open application windows; a given monitor requires more power to display a white (or light) screen than a black (or dark) screen.</p></blockquote>
<p>Roberson et al, 2002.</p>
<h2><span id="more-483"></span></h2>
<p>Just have a look at the Demo to see how it looks:</p>
<p><a class="button" href="/static/energy/">Energy Saving Javascript Demo</a></p>
<h2>How to Use</h2>
<p>Using this script is damn simple just place following script tag anywhere in the page. It would be good if you place this script just before <strong>&lt;/body&gt;</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://apps.nitinh.com/energy.js?time=100&amp;amp;credit=0&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<h3>Configuration</h3>
<p>There are two configurable parameters:</p>
<ul>
<li><strong>time</strong> : This is the amount of idle time before which the screen turn black. The time is in number of seconds and its value should be greater than 10.</li>
<li><strong>credit</strong> : This is boolean field to show / hide credits in Black Screen. Values could be 1 or 0</li>
</ul>
<p>Hope this script saves some of the valuable world energy.</p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/' rel='bookmark' title='Permanent Link: Beautiful Nag Screen using JQuery &amp; CSS3'>Beautiful Nag Screen using JQuery &amp; CSS3</a></li>
<li><a href='http://www.nitinh.com/2009/02/wtf-what-the-framework-bookmarklet-find-the-javascript-framework-being-used/' rel='bookmark' title='Permanent Link: WTF : What the Framework bookmarklet : Find the javascript framework being used'>WTF : What the Framework bookmarklet : Find the javascript framework being used</a></li>
<li><a href='http://www.nitinh.com/2009/02/dictionary-on-double-click-bookmarklet/' rel='bookmark' title='Permanent Link: Dictionary on double click : BookMarklet'>Dictionary on double click : BookMarklet</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2010/06/energy-saving-javascript/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Beautiful Nag Screen using JQuery &amp; CSS3</title>
		<link>http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/</link>
		<comments>http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 16:51:18 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[nag screen]]></category>
		<category><![CDATA[nagscreen]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/</guid>
		<description><![CDATA[TweetShareYesterday I wrote about a beautiful implementation for nag screen using mootools and CSS3. Thanks for all of my visitor for showing interest in it. Considering requests from some of the users, I have also worked on its jQuery version. In jQuery version I have also tried to remove the bugs pointed out by one [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/' rel='bookmark' title='Permanent Link: Beautiful Nag Screen using Mootools &amp; CSS3'>Beautiful Nag Screen using Mootools &amp; CSS3</a></li>
<li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
<li><a href='http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/' rel='bookmark' title='Permanent Link: Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools'>Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><p><img style="margin: 0px 10px 10px 0px; width: 130px; float: left; height: 130px;" src="http://imgur.com/r4ZM4.jpg" alt="" align="left" />Yesterday I wrote about a <a href="http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/">beautiful implementation for nag screen</a> using mootools and CSS3. Thanks for all of my visitor for showing interest in it.</p>
<p>Considering requests from some of the users, I have also worked on its jQuery version. In jQuery version I have also tried to remove the bugs pointed out by one of the user.</p>
<p><span id="more-457"></span></p>
<p>The new jQuery version also have following improvements:</p>
<ul>
<li>Close button can be used to close nag screen</li>
<li>Now the whole text doesn’t jumps when nag screen sticks to top</li>
</ul>
<p>thanks “<a href="http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/comment-page-1/#comment-5693">Seeker</a>” for pointing out these bugs.</p>
<p>Head over to Demo and download the source for this page.</p>
<p><a class="button" href="http://www.nitinh.com/static/nagScreen/jquery.html" target="_blank">Demo of Nag Screen</a></p>
<p><a class="button" href="http://www.nitinh.com/static/nagScreen/nagScreen_jquery.rar">Download Nag Screen Code</a></p>
<p>Be sure to check out the <a href="http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/">MooTools version</a>.</p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/' rel='bookmark' title='Permanent Link: Beautiful Nag Screen using Mootools &amp; CSS3'>Beautiful Nag Screen using Mootools &amp; CSS3</a></li>
<li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
<li><a href='http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/' rel='bookmark' title='Permanent Link: Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools'>Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Beautiful Nag Screen using Mootools &amp; CSS3</title>
		<link>http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/</link>
		<comments>http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 12:30:04 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[nag screen]]></category>
		<category><![CDATA[nagscreen]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/</guid>
		<description><![CDATA[TweetShareNagscreen : Messages on the webpage that reminds (or nags) the user to register, or show some notification. These messages appear on the webpage in a way to seek user attention. Here in this post we'll be creating beautiful and dynamic Nag Screen using Mootools. The application of nag screen is widespread, it widely used [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/' rel='bookmark' title='Permanent Link: Beautiful Nag Screen using JQuery &amp; CSS3'>Beautiful Nag Screen using JQuery &amp; CSS3</a></li>
<li><a href='http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Beautiful Thumbnail Hover Effect : Using Mootools'>Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Another Beautiful Thumbnail Hover Effect : Using Mootools'>Another Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><p><a href="http://www.nitinh.com/wp-content/uploads/2010/03/tweetie2icon.png"><img style="margin: 0px 10px 10px 0px; float: left;" title="Nag Screen" src="http://www.nitinh.com/wp-content/uploads/2010/03/tweetie2icon_thumb.png" border="0" alt="Nag Screen" width="152" height="152" align="left" /></a><strong>Nagscreen</strong> : Messages on the webpage that reminds (or nags) the user to register, or show some notification. These messages appear on the webpage in a way to seek user attention. Here in this post we'll be creating beautiful and dynamic Nag Screen using Mootools. <span id="more-450"></span></p>
<p>The application of nag screen is widespread, it widely used by various websites to show important messages on the webpage. Some examples of such screens are :</p>
<ul>
<li>Update notices in wordpress</li>
<li>Import address book message, which facebook shows</li>
<li>Registration messages shown on various websites</li>
</ul>
<p>So, considering such a wide use of nag screens I’ve tried to make them a little beautiful and flashy.</p>
<p>Just have a look at the demo to see the effect :</p>
<p><a class="button" href="/static/nagScreen/">Nag Screen Demo</a></p>
<p><a href="/static/nagScreen/"><img src="http://www.nitinh.com/wp-content/uploads/2010/03/Clipboard01.jpg" alt="" width="554" height="165" /></a></p>
<p>For capturing the scroll events I have used “<a href="http://mootools.net/forge/p/scrollspy" target="_blank">ScrollSpy</a>” developed by “<a href="http://davidwalsh.name" target="_blank">David Walsh</a>”. Thanks David for make such useful and easy to use plugin.</p>
<p>You can always access source of the webpage for its better understanding. To grab the source please download it here:</p>
<p><a class="button" href="/static/nagScreen/nagScreen.zip">Download Source</a></p>
<p>For further clarification and suggestions please drop comments.</p>
<p>Be sure to check out the <a href="http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/">jQuery version</a>.</p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/' rel='bookmark' title='Permanent Link: Beautiful Nag Screen using JQuery &amp; CSS3'>Beautiful Nag Screen using JQuery &amp; CSS3</a></li>
<li><a href='http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Beautiful Thumbnail Hover Effect : Using Mootools'>Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Another Beautiful Thumbnail Hover Effect : Using Mootools'>Another Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2010/03/beautiful-nag-screen-using-mootools-css3/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to Create a Simple Slideshow using Mootools / JQuery</title>
		<link>http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/</link>
		<comments>http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 17:13:47 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Photo]]></category>
		<category><![CDATA[Slideshow]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/</guid>
		<description><![CDATA[TweetShare When we want to show lots of content in limited screen space, Slideshows comes to rescue. Making use of slideshows is the optimal way to present large amount of information. In this post i'll walk you through the process of making a very simple(minimilistic) slideshow using Mootools / Jquery. &#160; You must have seen [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/' rel='bookmark' title='Permanent Link: Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools'>Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools</a></li>
<li><a href='http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Another Beautiful Thumbnail Hover Effect : Using Mootools'>Another Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/' rel='bookmark' title='Permanent Link: Beautiful Nag Screen using JQuery &amp; CSS3'>Beautiful Nag Screen using JQuery &amp; CSS3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><p><img style="margin: 0px 10px 10px 0px; float: left" title="slide_show_icon" border="0" alt="slide_show_icon" align="left" src="http://www.nitinh.com/wp-content/uploads/2010/03/slide_show_icon.gif" width="132" height="132" /> When we want to show lots of content in limited screen space, Slideshows comes to rescue. Making use of slideshows is the optimal way to present large amount of information. In this post i'll walk you through the process of making a very simple(minimilistic) slideshow using Mootools / Jquery. </p>
<p><span id="more-439"></span></p>
<div id='extendedEntryBreak' name='extendedEntryBreak'></div>
<p>&#160;</p>
<p>You must have seen various types of slideshows around the web. Creating such slideshow is also very simple. With little smart code one can make it very quickly.</p>
<p>As it is said “<b><a href="http://en.wikipedia.org/wiki/A_picture_is_worth_a_thousand_words" target="_blank">A picture is worth a thousand words</a></b>”, similarly I believe a demo is worth a thousand words. So lets hit the demo and try it ourselves.</p>
<table border="0" cellspacing="0" cellpadding="0" width="500">
<tbody>
<tr>
<td valign="top" width="250">
<p align="center"><a class="button" href="/static/SlideShow/mootools.html" target="_blank">Demo using Mootools</a></p>
</td>
<td valign="top" width="250">
<p align="center"><a class="button" href="/static/SlideShow/jquery.html" target="_blank">Demo using JQuery</a></p>
</td>
</tr>
</tbody>
</table>
<p>So, Interested ??? Lets head over to its implementation.</p>
<h3>Action Plan</h3>
<ul>
<li><strong>Step 1 :</strong> HTML Code Markup </li>
<li><strong>Step 2 :</strong> Setup CSS for the Slideshow </li>
<li><strong>Step 3 :</strong> Javascript for getting desired effect </li>
</ul>
<h4>Step 1 : HTML code</h4>
<p>In this step we’ll make basic markup for the slideshow. This basically consists two parts, one which shows the bigger picture and second to show list of thumbnails. Here is the necessary HTML code for these two parts.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bigPic&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/1.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/2.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/3.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/4.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/5.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/6.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/7.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/8.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/9.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/10.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbs&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;active&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/1_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/3_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;3&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/4_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;4&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/5_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;5&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/6_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;6&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/7_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;7&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/8_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;8&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/9_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;9&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/10_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;10&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imgs/2_thumb.jpg&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>Here fist div#bigPic contains all the big images in the slideshow. Whereas, the ul#thumbs contains thumbnails images. </p>
<h4>Step 2 : Necessary CSS Code</h4>
<p>This section shows, the necessary CSS code. CSS style used in demo for other styles are not included here.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#bigPic</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">940px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFF</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#bigPic</span> img<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #cc00cc;">#thumbs</span> li.active<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>	
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #cc00cc;">#thumbs</span><span style="color: #00AA00;">,</span> ul<span style="color: #cc00cc;">#thumbs</span> li<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #cc00cc;">#thumbs</span> li<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">7px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>	
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #cc00cc;">#thumbs</span> img<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>		
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h4>Step 3 : Javascript Magic</h4>
<p>The basic idea to get the effect is in following steps:</p>
<ol>
<li>Increase the z-index of current shown image</li>
<li>Show next image to be shown just below current image.</li>
<li>Now using fade out current image. This way next image will become visible.</li>
</ol>
<p>Equivalent JS code used is as follows.</p>
<h5>Using Mootools</h5>
<p>If you use JQuery directly head on to next section with JQuery code.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> currentImage<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> currentIndex <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> interval<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> showImage<span style="color: #009900;">&#40;</span>index<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>index<span style="color: #339933;">&lt;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'bigPic'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> indexImage <span style="color: #339933;">=</span> $$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#bigPic img'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>index<span style="color: #009900;">&#93;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>currentImage<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>currentImage <span style="color: #339933;">!=</span> indexImage <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                $<span style="color: #009900;">&#40;</span>currentImage<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'z-index'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                $clear<span style="color: #009900;">&#40;</span>myTimer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #003366; font-weight: bold;">var</span> myFx <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Fx.<span style="color: #660066;">Tween</span><span style="color: #009900;">&#40;</span>currentImage<span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
                    duration<span style="color: #339933;">:</span> <span style="color: #CC0000;">250</span><span style="color: #339933;">,</span>
                    onComplete<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                        $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setStyles</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'none'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'z-index'</span><span style="color: #339933;">:</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        myTimer <span style="color: #339933;">=</span> showNext.<span style="color: #660066;">delay</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">3000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span>currentImage<span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'opacity'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        indexImage.<span style="color: #660066;">setStyles</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'block'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'opacity'</span><span style="color: #339933;">:</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        currentImage <span style="color: #339933;">=</span> indexImage<span style="color: #339933;">;</span>
        currentIndex <span style="color: #339933;">=</span> index<span style="color: #339933;">;</span>
        $$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#thumbs li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#thumbs li'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>index<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> showNext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> len <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'bigPic'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> next <span style="color: #339933;">=</span> currentIndex <span style="color: #339933;">&lt;</span> <span style="color: #009900;">&#40;</span>len<span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> currentIndex <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span> <span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
    showImage<span style="color: #009900;">&#40;</span>next<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> myTimer<span style="color: #339933;">;</span>
window.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'domready'</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>
    myTimer <span style="color: #339933;">=</span> showNext.<span style="color: #660066;">delay</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">3000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    showNext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//loads first image</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'thumbs'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> count <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rel'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        showImage<span style="color: #009900;">&#40;</span>parseInt<span style="color: #009900;">&#40;</span>count<span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h5>JQuery Implementation</h5>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> currentImage<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> currentIndex <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> interval<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> showImage<span style="color: #009900;">&#40;</span>index<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>index <span style="color: #339933;">&lt;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#bigPic img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> indexImage <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#bigPic img'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>index<span style="color: #009900;">&#93;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>currentImage<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>currentImage <span style="color: #339933;">!=</span> indexImage <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                $<span style="color: #009900;">&#40;</span>currentImage<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'z-index'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                clearTimeout<span style="color: #009900;">&#40;</span>myTimer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                $<span style="color: #009900;">&#40;</span>currentImage<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">250</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>
                    myTimer <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;showNext()&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">3000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'none'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'z-index'</span><span style="color: #339933;">:</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        $<span style="color: #009900;">&#40;</span>indexImage<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'block'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'opacity'</span><span style="color: #339933;">:</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        currentImage <span style="color: #339933;">=</span> indexImage<span style="color: #339933;">;</span>
        currentIndex <span style="color: #339933;">=</span> index<span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#thumbs li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#thumbs li'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>index<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> showNext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> len <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#bigPic img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> next <span style="color: #339933;">=</span> currentIndex <span style="color: #339933;">&lt;</span> <span style="color: #009900;">&#40;</span>len<span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> currentIndex <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span> <span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
    showImage<span style="color: #009900;">&#40;</span>next<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> myTimer<span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    myTimer <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;showNext()&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">3000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    showNext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Load first image</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#thumbs li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> count <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rel'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        showImage<span style="color: #009900;">&#40;</span>parseInt<span style="color: #009900;">&#40;</span>count<span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I have tried to keep the javascript code really simple if you still feel it difficult to understand just drop a comment about it. I'll try to explain your doubts.</p>
<h3>Download Code</h3>
<p>JQuery Implementation : <a href="/static/SlideShow/SlideShow-JQuery.zip" target="_blank"><strong>Sideshow-Jquery.zip</strong></a><br />
Mootools Implementation : <a href="/static/SlideShow/SlideShow-Mootools.zip" target="_blank"><strong>Sideshow-Mootools.zip</strong></a></p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/' rel='bookmark' title='Permanent Link: Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools'>Vertical-Align : Middle Using Javascript : JQuery &#038; Mootools</a></li>
<li><a href='http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Another Beautiful Thumbnail Hover Effect : Using Mootools'>Another Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/03/beautiful-nag-screen-using-jquery-css3/' rel='bookmark' title='Permanent Link: Beautiful Nag Screen using JQuery &amp; CSS3'>Beautiful Nag Screen using JQuery &amp; CSS3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/feed/</wfw:commentRss>
		<slash:comments>82</slash:comments>
		</item>
		<item>
		<title>Vertical-Align : Middle Using Javascript : JQuery &amp; Mootools</title>
		<link>http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/</link>
		<comments>http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 06:58:33 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[align]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javasript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Middle]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Position]]></category>
		<category><![CDATA[vertical-align]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/?p=345</guid>
		<description><![CDATA[TweetShareHow do I vertically center my stuff inside this area ? If you are looking for an answer for the above question then possibly you've landed on the correct page. The very first solution for this is to have vertical-align:middle in your css. But unfortunately this CSS property only works on table-cell and img. Gavin [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
<li><a href='http://www.nitinh.com/2009/03/css-on-tables-html-tables-20/' rel='bookmark' title='Permanent Link: CSS on Tables : HTML Tables 2.0'>CSS on Tables : HTML Tables 2.0</a></li>
<li><a href='http://www.nitinh.com/2011/05/how-to-properly-hide-and-show-elements-using-javascript/' rel='bookmark' title='Permanent Link: How to Properly Hide and Show Elements Using Javascript'>How to Properly Hide and Show Elements Using Javascript</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><h2>How do I vertically center my stuff inside this area ?</h2>
<p>If you are looking for an answer for the above question then possibly you've landed on the correct page. The very first solution for this is to have <code>vertical-align:middle</code> in your css. But unfortunately this CSS property only works on <code>table-cell</code> and <code>img</code>.<span id="more-345"></span><br />
<strong>Gavin Kistner</strong> have written a great article about this : <a href="http://phrogz.net/CSS/vertical-align/index.html">How (Not) To Vertically Center Content</a>.</p>
<p>Personally I feel it very cumbersome to style items as a table/table cell to get it aligned. I prefer using Javascript for positioning the block in middle. There may be situations where you would not like to use javascript then CSS is always there for you.</p>
<p>The basic idea in this approach is to wrap all child elements in a div and position this div in middle using Javascript.</p>
<h3>Jquery Implementation</h3>
<p>This is a jQuery plugin that will allow you to use the function in the jQuery chain. Something like :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">vAlign</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a class="button" rel="nofollow" href="/static/vAlign/jquery.html">View Demo</a></p>
<h4>Plugin Code</h4>
<p>The Plugin code is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$.<span style="color: #660066;">fn</span>.<span style="color: #660066;">vAlign</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: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">wrapAll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div class=&quot;nitinh-vAlign&quot; style=&quot;position:relative;&quot;&gt;&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.nitinh-vAlign'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> ph <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> dh <span style="color: #339933;">=</span> div.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> mh <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ph <span style="color: #339933;">-</span> dh<span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
        div.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> mh<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Mootools Plugin</h3>
<p>This is a Mootools plugin that will allow you to use is on any Element to get its child elements align in middle. The code is something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> v <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> vAlign<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'container'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a class="button" rel="nofollow" href="/static/vAlign/mootools.html">View Demo</a></p>
<h4>Plugin Code</h4>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">vAlign <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	initialize<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span> <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Element<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #3366CC;">'class'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'nitinh-vAlign'</span><span style="color: #339933;">,</span>
                    <span style="color: #3366CC;">'styles'</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #3366CC;">'position'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'relative'</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        div.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">'html'</span><span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'html'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
        div.<span style="color: #660066;">inject</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> ph <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">getSize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">y</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> dh <span style="color: #339933;">=</span> div.<span style="color: #660066;">getSize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">y</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> mh <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ph <span style="color: #339933;">-</span> dh<span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
        div.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'styles'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
            <span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span>mh
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<h4>It's not working for you</h4>
<p>If this plugin is not working for you then may be there is some <code>margin</code> and <code>padding</code> applied in the code. Try changing it.</p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
<li><a href='http://www.nitinh.com/2009/03/css-on-tables-html-tables-20/' rel='bookmark' title='Permanent Link: CSS on Tables : HTML Tables 2.0'>CSS on Tables : HTML Tables 2.0</a></li>
<li><a href='http://www.nitinh.com/2011/05/how-to-properly-hide-and-show-elements-using-javascript/' rel='bookmark' title='Permanent Link: How to Properly Hide and Show Elements Using Javascript'>How to Properly Hide and Show Elements Using Javascript</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2010/01/vertical-align-middle-using-javascript-jquery-mootools/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Another Beautiful Thumbnail Hover Effect : Using Mootools</title>
		<link>http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/</link>
		<comments>http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 09:11:02 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Effect]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Thumbnail]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/?p=330</guid>
		<description><![CDATA[TweetShareSome days back I wrote a post regarding "Beautiful Thumbnail Hover Effect". On getting such a good response about the javascript effect I am again presenting a different thumbnail presentation. This implementation is little different.  To know more about this effect lets see the demo first. View Demo If you have seen the demo then [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Beautiful Thumbnail Hover Effect : Using Mootools'>Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
<li><a href='http://www.nitinh.com/2009/10/make-your-links-hyperlinks-even-more-sexier/' rel='bookmark' title='Permanent Link: Make Your Links (Hyperlinks) Even More Sexier'>Make Your Links (Hyperlinks) Even More Sexier</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><p><img class="alignleft" style="margin: 0 10px 10px 0;" title="Beautiful Thumbnail Hover Effect : Using Mootools" src="http://imgur.com/rZ1Uy.jpg" alt="" width="177" height="177" />Some days back I wrote a post regarding "<a href="http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/">Beautiful Thumbnail Hover Effect</a>". On getting such a good response about the javascript effect I am again presenting a different thumbnail presentation.</p>
<p><span id="more-330"></span></p>
<p>This implementation is little different.  To know more about this effect lets see the demo first.</p>
<p><a class="button" rel="nofollow" href="/static/another_thumb/index.html">View Demo</a></p>
<p>If you have seen the demo then you might be wondering how this image is splitting in middle. Actually to get this effect I have used two instances of the same image. One instance goes toward left while second image goes right, in effect giving an illusion that image is splitting in middle.</p>
<p><img src="http://imgur.com/QQ4Zo.jpg" /></p>
<p>Now lets move on to its implementation.</p>
<h3>The HTML</h3>
<p>Here i am given html code to showing one thumbnail:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'thumb'</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'someContent'</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'content'</span>&gt;</span>Some Random Text Over Here.  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'more'</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>More <span style="color: #ddbb00;">&amp;raquo;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'divLeft'</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'left:0px'</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'divLeftImage'</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'background:url(7.jpg);'</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'divLeftShadow'</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'divRight'</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'left:0px;background-image:url(7.jpg);'</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbnail-shadow&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bottom&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbnail-shadow.png&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>This code looks to me as self explanatory. </p>
<h3>The CSS</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div.thumb<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">160px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">160px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#313131</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.divLeft</span><span style="color: #00AA00;">,</span> div.divRight<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">90px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">160px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">-160px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div.divLeft<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">-10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div.divLeftImage<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div.divLeftShadow<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'shadow.png'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div.divRight<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #933;">-80px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.thumbnail-shadow</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">33px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-320px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div.someContent<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">160px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>Arial<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">justify</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">thumbnail-overlay.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #933;">0px</span> <span style="color: #933;">-167px</span><span style="color: #00AA00;">;</span>
&nbsp;
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.someContent</span> div.<span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">126px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.someContent</span> div.more<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">readmore-bg.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">3px</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>Javascript : Mootools</h3>
<p>And Finally the magic of Mootools to get the desired effect. To get the desired effect I am moving div.divLeft 70px toward left, and moving div.divRight 80px toward right. At the same time the background image for the background text is coming down.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.thumb'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>div<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	div.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.someContent'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tween'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>duration<span style="color: #339933;">:</span><span style="color: #3366CC;">'700'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	div.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.divLeft'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tween'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>duration<span style="color: #339933;">:</span> <span style="color: #3366CC;">'450'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	div.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.divRight'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tween'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>duration<span style="color: #339933;">:</span> <span style="color: #3366CC;">'450'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	div.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mouseenter'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.divLeft'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'-70px'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.divRight'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'80px'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.someContent'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;background-position&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;-20px 0px&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
	div.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mouseleave'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.divLeft'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'0px'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.divRight'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'0px'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.someContent'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;background-position&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;0px -167px&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>The whole code is available for download :</p>
<p><a class="button" rel="nofollow" href="/static/another_thumb.zip">Download Another_Thumbnail.zip</a></p>
<p>Hope you guys will like it. Let me hear your feedbacks through comments. </p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Beautiful Thumbnail Hover Effect : Using Mootools'>Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
<li><a href='http://www.nitinh.com/2009/10/make-your-links-hyperlinks-even-more-sexier/' rel='bookmark' title='Permanent Link: Make Your Links (Hyperlinks) Even More Sexier'>Make Your Links (Hyperlinks) Even More Sexier</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Make Your Links (Hyperlinks) Even More Sexier</title>
		<link>http://www.nitinh.com/2009/10/make-your-links-hyperlinks-even-more-sexier/</link>
		<comments>http://www.nitinh.com/2009/10/make-your-links-hyperlinks-even-more-sexier/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 14:17:47 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Hyperlink]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Sexy]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/?p=322</guid>
		<description><![CDATA[TweetShareYou would have often seen various attempts to make hyperlink more beautiful. One of my personal favorite is to have little icons beside links to let you know where they link to. Different icons for external links, pdfs, images, etc. etc. You can find the tutorial for such link over here. In this post i'll tell [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Another Beautiful Thumbnail Hover Effect : Using Mootools'>Another Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Beautiful Thumbnail Hover Effect : Using Mootools'>Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2009/10/make-your-links-hyperlinks-even-more-sexier/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2009/10/make-your-links-hyperlinks-even-more-sexier/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><p><img class="alignleft" style="margin: 0 10px 10px 0;" src="http://imgur.com/ZaS5D.png" alt="HyperLink" width="128" height="128" />You would have often seen various attempts to make hyperlink more beautiful. One of my personal favorite is to have little icons beside links to let you know where they link to.<br />
Different icons for external links, pdfs, images, etc. etc. You can find the tutorial for such link over <a rel="nofollow" href="http://www.devirtuoso.com/2009/08/making-hyperlink-icons-with-css/">here</a>.</p>
<p><span id="more-322"></span></p>
<p>In this post i'll tell you a technique using which you can make your links even more sexier.</p>
<p>Check out the demo first : <a class="button" href="/static/hyperlink/index.html" target="_blank">View Demo</a></p>
<p>The Implementation of this effect is given in the following sections.</p>
<h3>The HTML</h3>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;link&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Put Anything Here<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<p>All you need is to add classname "link" to your hyperlinks.</p>
<h3>The CSS</h3>
<p>The only important class is to have the final class "a.link".</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span>a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span>a<span style="color: #3333ff;">:active</span><span style="color: #00AA00;">,</span>a<span style="color: #3333ff;">:visited</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#59BAEF</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span><span style="color: #993333;">nowrap</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
a<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
a.link<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">a-bg.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">-81px</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>The Javascript : Mootools</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">window.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'domready'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.link'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		a.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'backgroundPosition'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;-81px &quot;</span><span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">getSize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">y</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		a.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tween'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>duration<span style="color: #339933;">:</span><span style="color: #CC0000;">600</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		a.<span style="color: #660066;">addEvents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #3366CC;">'mouseenter'</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>
				a.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'backgroundPosition'</span><span style="color: #339933;">,</span> a.<span style="color: #660066;">getSize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;px &quot;</span><span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">getSize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">y</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			<span style="color: #3366CC;">'mouseleave'</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>
				a.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'backgroundPosition'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;-81px &quot;</span><span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">getSize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">y</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<h3>The Javascript : jQuery</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.link'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'backgroundPosition'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;-81px &quot;</span><span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">outerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.link'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mouseenter'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        a.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'backgroundPosition'</span><span style="color: #339933;">:</span> a.<span style="color: #660066;">outerWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;px &quot;</span><span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">outerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.link'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mouseleave'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>
        a.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'backgroundPosition'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;-81px &quot;</span><span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">outerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">600</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></pre></div></div>

<h3>Image Used</h3>
<p><a href="/static/hyperlink/a-bg.png" target="_blank"><img style="border:none;padding:0px" src="/static/hyperlink/a-bg.png" alt="" /></a></p>
<p>This effect is just a demo of the possibilities. I would love to here your own implementations.</p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Another Beautiful Thumbnail Hover Effect : Using Mootools'>Another Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Beautiful Thumbnail Hover Effect : Using Mootools'>Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2009/10/make-your-links-hyperlinks-even-more-sexier/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Show IMDB Ratings on Torrentz.com using GreaseMonkey Script</title>
		<link>http://www.nitinh.com/2009/10/show-imdb-ratings-on-torrentzcom-using-greasemonkey-script/</link>
		<comments>http://www.nitinh.com/2009/10/show-imdb-ratings-on-torrentzcom-using-greasemonkey-script/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 18:04:16 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[GM]]></category>
		<category><![CDATA[GreaseMonkey]]></category>
		<category><![CDATA[IMDB]]></category>
		<category><![CDATA[rating]]></category>
		<category><![CDATA[Torrentz]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/?p=309</guid>
		<description><![CDATA[TweetShareTorrentz.com is a great site. It is a basically a one stop destination for any torrent search. I personally find it very useful as it automatically syndicate all the torrents from various sites like piratebay, mininova, demonoid etc. Before downloading any movie from torrent I usually check its rating, synopsis &#38; star cast on IMDB. [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2009/02/why-django-orm-sucks-it-takes-a-hell-lot-of-memory-in-processing/' rel='bookmark' title='Permanent Link: Why Django ORM Sucks : It takes a hell lot of memory in processing.'>Why Django ORM Sucks : It takes a hell lot of memory in processing.</a></li>
<li><a href='http://www.nitinh.com/2011/05/how-to-properly-hide-and-show-elements-using-javascript/' rel='bookmark' title='Permanent Link: How to Properly Hide and Show Elements Using Javascript'>How to Properly Hide and Show Elements Using Javascript</a></li>
<li><a href='http://www.nitinh.com/2009/02/dictionary-on-double-click-bookmarklet/' rel='bookmark' title='Permanent Link: Dictionary on double click : BookMarklet'>Dictionary on double click : BookMarklet</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2009/10/show-imdb-ratings-on-torrentzcom-using-greasemonkey-script/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2009/10/show-imdb-ratings-on-torrentzcom-using-greasemonkey-script/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><p><img class="alignleft" style="margin: 0 10px 10px 0;" title="Grease Monkey" src="http://imgur.com/3iLb7.gif" alt="" width="160" height="160" />Torrentz.com is a great site. It is a basically a one stop destination for any torrent search. I personally find it very useful as it automatically syndicate all the torrents from various sites like piratebay, mininova, demonoid etc.</p>
<p>Before downloading any movie from torrent I usually check its rating, synopsis &amp; star cast on IMDB. I find this process very cumbersome and boring to search each movie on IMDB. To ease out this process I searched for a GM Script(GreaseMonkey Script). I found one, but it wasn't perfect so I have modified it. <span id="more-309"></span>You can find its updated version at <a href="http://userscripts.org/scripts/show/59570">IMDB Rating in Torrentz</a></p>
<p><a href="http://imgur.com/6ADGL.jpg" target="_blank"><img class="alignnone" title="GreaseMonkey Script to show IMDB ratings in Torrentz" src="http://imgur.com/6ADGL.jpg" alt="" width="600" /></a></p>
<h3>How to install this</h3>
<ul>
<li>Install <a href="https://addons.mozilla.org/en-US/firefox/addon/748">greasemonkey extension</a> for firefox if you have not already done so.</li>
<li>Go to <a href="http://userscripts.org/scripts/show/59570">http://userscripts.org/scripts/show/59570</a> and click on the “Install this Script” link on the right side</li>
</ul>
<h3>More Information</h3>
<p>Don't know what GreaseMonkey is : <a href="http://en.wikipedia.org/wiki/Greasemonkey" target="_blank">Read Here</a></p>
<p>Don't Know how to install GreaseMonkey Addon : <a href="http://diveintogreasemonkey.org/install/greasemonkey.html" target="_blank">Read Here</a></p>
<h4>Don't Know How to install Script in Greasemonkey</h4>
<p><object width="425" height="425" data="http://www.instructables.com/static/flash/viewer.swf" type="application/x-shockwave-flash"><param name="align" value="middle" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="FlashVars" value="title=How-to-Install-Scripts-for-Greasemonkey" /><param name="src" value="http://www.instructables.com/static/flash/viewer.swf" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="title=How-to-Install-Scripts-for-Greasemonkey" /></object></p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2009/02/why-django-orm-sucks-it-takes-a-hell-lot-of-memory-in-processing/' rel='bookmark' title='Permanent Link: Why Django ORM Sucks : It takes a hell lot of memory in processing.'>Why Django ORM Sucks : It takes a hell lot of memory in processing.</a></li>
<li><a href='http://www.nitinh.com/2011/05/how-to-properly-hide-and-show-elements-using-javascript/' rel='bookmark' title='Permanent Link: How to Properly Hide and Show Elements Using Javascript'>How to Properly Hide and Show Elements Using Javascript</a></li>
<li><a href='http://www.nitinh.com/2009/02/dictionary-on-double-click-bookmarklet/' rel='bookmark' title='Permanent Link: Dictionary on double click : BookMarklet'>Dictionary on double click : BookMarklet</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2009/10/show-imdb-ratings-on-torrentzcom-using-greasemonkey-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Beautiful Thumbnail Hover Effect : Using Mootools</title>
		<link>http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/</link>
		<comments>http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 07:37:56 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Effect]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Thumbnail]]></category>

		<guid isPermaLink="false">http://www.nitinh.com/?p=254</guid>
		<description><![CDATA[TweetShare Thumbnails of photos is very common part of any website. We have seen a lot of innovation and beautiful representation of thumbnails. Recently I came across a beautiful hover effect on thumbnails. Without saying much first see what is this effect. View Demo The Implementation of this effect is given in the following sections. [...]


Related posts:<ol><li><a href='http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Another Beautiful Thumbnail Hover Effect : Using Mootools'>Another Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
<li><a href='http://www.nitinh.com/2009/10/make-your-links-hyperlinks-even-more-sexier/' rel='bookmark' title='Permanent Link: Make Your Links (Hyperlinks) Even More Sexier'>Make Your Links (Hyperlinks) Even More Sexier</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="socializeWP" data-url="http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="socialize-in-button-left"><a name="fb_share" type="box_count" share_url="http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div></div><p><img class="imgThumb alignleft" style="margin: 0 10px 10px 0;" title="Thumbnail Effect" src="http://imgur.com/Tbjux.jpg" alt="Thumbnail Effect" width="140" height="140" /> Thumbnails of photos is very common part of any website. We have seen a lot of innovation and beautiful representation of thumbnails. Recently I came across a beautiful hover effect on thumbnails. Without saying much first see what is this effect.</p>
<p><span id="more-254"></span></p>
<p><a class="button" href="/static/Thumbnails/index.html">View Demo</a></p>
<div style='clear:both;float:none'></div>
<p><img class="imgThumb" title="Thumbnail Effect" src="http://imgur.com/ikWew.jpg" alt="Thumbnail Effect" width="400" height="253" /></p>
<p>The Implementation of this effect is given in the following sections.</p>
<h3>The HTML</h3>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbnail-wrap&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbnail-div&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-image: url(5_thumb.jpg);&quot;</span>&gt;</span>
   <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbnail-shadow&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbnail-shadow.png&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bottom&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sections-overlay&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imagezoom&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;5.jpg&quot;</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;zoom&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;zoom.png&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Some Title of the Image 5&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;readmore&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>read more <span style="color: #ddbb00;">&amp;gt;&amp;gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>I think the code here is self explanatory.</p>
<h3>The CSS</h3>
<p>The CSS for the effect is a bit lengthy, as lots of hidden elements are involved.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.thumbnail-wrap</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">151px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">151px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.thumbnail-div</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#313131</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">146px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">146px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.thumbnail-shadow</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">33px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.thumbnail-div</span> <span style="color: #6666ff;">.sections-overlay</span> <span style="color: #00AA00;">&#123;</span>
	-moz-background-<span style="color: #000000; font-weight: bold;">clip</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">;</span>
	-moz-background-inline-policy<span style="color: #00AA00;">:</span><span style="color: #993333;">continuous</span><span style="color: #00AA00;">;</span>
	-moz-background-origin<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">thumbnail-overlay.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #933;">-40px</span> <span style="color: #933;">-300px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">-33px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.thumbnail-div</span> div<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">141px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">141px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sections-overlay</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">readmore-bg.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">-167px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.thumbnail-div</span> <span style="color: #6666ff;">.sections-overlay</span> <span style="color: #6666ff;">.zoom</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">60px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">61px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sections-overlay</span> <span style="color: #6666ff;">.zoom</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">medium</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">165px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">312px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.readmore</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">readmore-bg.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">17px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>The Javascript : Mootools</h3>
<p>And Finally the magic of Mootools to get the desired effect. All this effect is doing to decrease the margin-top of "thumbnail-div" by 10px and showing "sections-overlay" div using opacity:1.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.thumbnail-div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>div<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  div.<span style="color: #660066;">addEvents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #3366CC;">'mouseover'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'marginTop'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'-10px'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.sections-overlay'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        d.<span style="color: #660066;">morph</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> backgroundPosition<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;-40px 0px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">'mouseout'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'marginTop'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'0px'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.sections-overlay'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        d.<span style="color: #660066;">morph</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> backgroundPosition<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0px -167px&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Doing just this we'll get such an amazing effect on Thumbnails. This effect is just a demo of the possibilities. One can use the same technique to show the Title of the Image or RunTime and Title of Video Thumbnail.</p>
<p><strong>The whole code is available for download :</strong></p>
<p><a class="button" href="http://nitinhayaran.googlepages.com/Thumbnails.zip">Download Thumbnail.zip</a></p>
<p>Hope you guys will like it. Let me hear new implementation through comments.</p>


<p>Related posts:<ol><li><a href='http://www.nitinh.com/2009/11/another-beautiful-thumbnail-hover-effect-using-mootools/' rel='bookmark' title='Permanent Link: Another Beautiful Thumbnail Hover Effect : Using Mootools'>Another Beautiful Thumbnail Hover Effect : Using Mootools</a></li>
<li><a href='http://www.nitinh.com/2010/03/how-to-create-a-simple-slideshow-using-mootools-jquery/' rel='bookmark' title='Permanent Link: How to Create a Simple Slideshow using Mootools / JQuery'>How to Create a Simple Slideshow using Mootools / JQuery</a></li>
<li><a href='http://www.nitinh.com/2009/10/make-your-links-hyperlinks-even-more-sexier/' rel='bookmark' title='Permanent Link: Make Your Links (Hyperlinks) Even More Sexier'>Make Your Links (Hyperlinks) Even More Sexier</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.nitinh.com/2009/10/beautiful-thumbnail-hover-effect-using-mootools/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
