<?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>Subooa Studios Blog &#187; Ajax &amp; Javascript</title>
	<atom:link href="http://blog.subooa.com/category/development/ajax_and_javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.subooa.com</link>
	<description>Custom development by Chris Duell aka duellsy</description>
	<lastBuildDate>Wed, 28 Jul 2010 03:57:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Random Fading Rotator with jQuery</title>
		<link>http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/</link>
		<comments>http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 07:51:26 +0000</pubDate>
		<dc:creator>Chris Duell</dc:creator>
				<category><![CDATA[Ajax & Javascript]]></category>

		<guid isPermaLink="false">http://blog.subooa.com/?p=341</guid>
		<description><![CDATA[This article is going to cover the basics in having a set list of elements fade through each other in rotation, but in a random order, so that your users aren't always seeing the same items first and all the elements get a fair run.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fajax_and_javascript%2Frandom-fading-rotator-with-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fajax_and_javascript%2Frandom-fading-rotator-with-jquery%2F&amp;source=duellsy&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>A quick demo of what this article will build can be seen here:<br />
<a href="http://blog.subooa.com/example/randomfadingrotator/images.html">http://blog.subooa.com/example/randomfadingrotator/images.html</a></p>
<p>First of all, setup a list of elements on your page something like below:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p341code1'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3411"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p341code1"><pre class="html" style="font-family:monospace;">&nbsp;
		&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:0--&gt;&lt;/script&gt;
		&lt;script src=&quot;rfr.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:1--&gt;&lt;/script&gt;
&lt;div id=&quot;rotating_items&quot;&gt;
&lt;div class=&quot;rotating_item&quot;&gt;
				&lt;img src=&quot;first_image.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rotating_item&quot;&gt;
				&lt;img src=&quot;second_image.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rotating_item&quot;&gt;
				&lt;img src=&quot;third_image.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>Viewing the above code will show you a simple list of images in an unordered list, nothing fancy at all, so to get the items in the right place and remove the default styling we need to generate the css file (which as you may have noticed we are going to call rfr.css)</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p341code2'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3412"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code" id="p341code2"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;Trebuchet MS&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Geneva CY&quot;</span><span style="color: #00AA00;">,</span> Verdana<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#414141</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
h3<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#rotating_items</span><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: #00AA00;">&#125;</span>
	<span style="color: #cc00cc;">#rotating_items</span> h3<span style="color: #00AA00;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #cc00cc;">#rotating_items</span> div.rotating_item<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: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Again, there&#8217;s nothing overly complicated in this set of css classes, all that is happening is that each of the elements is being told to display on top of each other, so refreshing your page now you will see only one image. The other images are tucked in behind it, ready to be rotated through.</p>
<p>Now comes the fun part, the javascript. Again, you may have noticed that this javascript file we are going to call rfr.js</p>
<p>As noted earlier, we&#8217;re going to pick an element at random from the list available to fade in while the current image fades out.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p341code3'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3413"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code" id="p341code3"><pre class="javascript" style="font-family:monospace;">jQuery<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>
	showing <span style="color: #339933;">=</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#rotating_items div.rotating_item:first'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Initiate the 'showing' variable as the first rotating_item</span>
	showing.<span style="color: #660066;">siblings</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Hide all other rotating_items</span>
	setInterval<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;show_next_rotating_item(showing)&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Set the rotate time to 5 seconds</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Below is the code that picks an item at random to display</span>
jQuery.<span style="color: #660066;">jQueryRandom</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
jQuery.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>jQuery.<span style="color: #660066;">expr</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;:&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#123;</span>
    random<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> m<span style="color: #339933;">,</span> r<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>i <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            jQuery.<span style="color: #660066;">jQueryRandom</span> <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> r.<span style="color: #660066;">length</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: #000066; font-weight: bold;">return</span> i <span style="color: #339933;">==</span> jQuery.<span style="color: #660066;">jQueryRandom</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #006600; font-style: italic;">// The below function repeatedly gets called, to do the rotating</span>
<span style="color: #003366; font-weight: bold;">function</span> show_next_rotating_item<span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	jQuery<span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> next_rotating_item <span style="color: #339933;">=</span> jQuery<span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">siblings</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.rotating_item:random'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>next_rotating_item.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		next_rotating_item <span style="color: #339933;">=</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#rotating_items div.rotating_item:first'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	next_rotating_item.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	showing <span style="color: #339933;">=</span> next_rotating_item<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The main things to notice here are the &#8216;random&#8217; extension of jQuery, and the use of the randoms selector when using the &#8216;siblings&#8217; function call. This allows is to pick a random sibling element of the element that is currently being displayed.</p>
<p>This can be used with pretty much anything, including content based divs. The example here:<br />
<a href="http://blog.subooa.com/example/randomfadingrotator/testimonials.html">http://blog.subooa.com/example/randomfadingrotator/testimonials.html</a><br />
Shows a set of testimonials that rotate at random, the added bonus here if you view the javascript source for this version, is that the entire element becomes a hot spot for the link, so the use can click anywhere on the item. It also has some extra code in there to allow you to track the clicks as an event in Google if you so wish.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/&amp;title=Random+Fading+Rotator+with+jQuery" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/&amp;title=Random+Fading+Rotator+with+jQuery" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/&amp;title=Random+Fading+Rotator+with+jQuery&amp;desc=This%20article%20is%20going%20to%20cover%20the%20basics%20in%20having%20a%20set%20list%20of%20elements%20fade%20through%20each%20other%20in%20rotation%2C%20but%20in%20a%20random%20order%2C%20so%20that%20your%20users%20aren%27t%20always%20seeing%20the%20same%20items%20first%20and%20all%20the%20elements%20get%20a%20fair%20run." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/&amp;title=Random+Fading+Rotator+with+jQuery" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/&amp;title=Random+Fading+Rotator+with+jQuery" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Random+Fading+Rotator+with+jQuery+-+http://bit.ly/1J5ZYM&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fajax_and_javascript%2Frandom-fading-rotator-with-jquery%2F","http:\/\/twitter.com\/home?status=Random+Fading+Rotator+with+jQuery+-+http:\/\/bit.ly\/1J5ZYM&amp;source=shareaholic"];var wordpress_toolbar_url = "";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2Jsb2cuc3Vib29hLmNvbS9kZXZlbG9wbWVudC9hamF4X2FuZF9qYXZhc2NyaXB0L3JhbmRvbS1mYWRpbmctcm90YXRvci13aXRoLWpxdWVyeS88d3B0Yj5SYW5kb20gRmFkaW5nIFJvdGF0b3Igd2l0aCBqUXVlcnk8d3B0Yj5odHRwOi8vYmxvZy5zdWJvb2EuY29tPHdwdGI%2BU3Vib29hIFN0dWRpb3MgQmxvZw%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://blog.subooa.com/development/ajax_and_javascript/random-fading-rotator-with-jquery/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Creating a Dropdown Menu with jQuery and CSS</title>
		<link>http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/</link>
		<comments>http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 10:59:31 +0000</pubDate>
		<dc:creator>Chris Duell</dc:creator>
				<category><![CDATA[Ajax & Javascript]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[dropdown]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://blog.subooa.com/?p=324</guid>
		<description><![CDATA[I often see requests for help on how to create a simple dropdown menu without requiring too much effort, and usually I direct people to an article for 'son of suckerfish', but since jQuery is in most sites I use now I have moved to using a jQuery based dropdown that is much simpler.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fhtml_and_css%2Fcreating-a-dropdown-menu-with-jquery-and-css%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fhtml_and_css%2Fcreating-a-dropdown-menu-with-jquery-and-css%2F&amp;source=duellsy&amp;style=normal&amp;service=bit.ly&amp;hashtags=dropdown,jquery,menu" height="61" width="50" /><br />
			</a>
		</div>
<h3>The raw base</h3>
<p>To start off with, we&#8217;re going to at least need some sort of menu structure to get us going. For this, the best way to structure the menu is using an unordered list (ul), nesting your submenus as you go. Below is the example we&#8217;re going to use in this demo it its raw unstyled format. </p>
<p>(The running demo is here &#8211; <a href="http://blog.subooa.com/example/css_jquery_dropdown.html">http://blog.subooa.com/example/css_jquery_dropdown.html</a>)</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p324code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3244"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code" id="p324code4"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!</span>DOCTYPE html <span style="color: #000000; font-weight: bold;">PUBLIC</span> <span style="color: #0000ff;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #0000ff;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>Creating a dropdown menu with jQuery and CSS<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;mainmenu&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>ul<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Menu item <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>ul<span style="color: #339933;">&gt;</span>
				<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Submenu item <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
				<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Submenu item <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Menu item <span style="color: #cc66cc;">2</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Menu item <span style="color: #cc66cc;">3</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Menu item <span style="color: #cc66cc;">4</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>ul<span style="color: #339933;">&gt;</span>
				<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Submenu item <span style="color:#800080;">4.1</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
				<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Submenu item <span style="color:#800080;">4.2</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>Menu item <span style="color: #cc66cc;">5</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Opening that in a browser is going to be pretty plain, something like this:<br />
<img src="http://blog.subooa.com/wp-content/uploads/2009/07/raw_menu.jpg" alt="raw_menu" title="raw_menu" width="285" height="147" class="alignnone size-full wp-image-325" /></p>
<h3>A little css</h3>
<p>For the sake of this tutorial we&#8217;re only going to give the menu a basic look and not get too fancy. So we&#8217;ll just create a nice green and black menu.</p>
<p>The nav we are going to create is going to be a left to right manu, with the second level popping out below its parent, so we first need to order the items left to right and get the submenu it the right position. (To keep it simple, the style is going to be added to the same file and not extracted into a saperate stylesheet)</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p324code5'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3245"><td class="line_numbers"><pre>6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
</pre></td><td class="code" id="p324code5"><pre class="css" style="font-family:monospace;">	&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
&nbsp;
		body<span style="color: #00AA00;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</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> Verdana<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> Sans-Serif<span style="color: #00AA00;">;</span>
		<span style="color: #00AA00;">&#125;</span>
&nbsp;
		<span style="color: #cc00cc;">#mainmenu</span> ul<span style="color: #00AA00;">&#123;</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: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</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;">#393</span><span style="color: #00AA00;">;</span>
			<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
			<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #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: #00AA00;">&#125;</span>
			<span style="color: #cc00cc;">#mainmenu</span> ul 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;">list-style</span><span style="color: #00AA00;">:</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;">0px</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;">height</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;">100px</span><span style="color: #00AA00;">;</span>
			<span style="color: #00AA00;">&#125;</span>
				<span style="color: #cc00cc;">#mainmenu</span> ul li a<span style="color: #00AA00;">&#123;</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;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</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;">30px</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;">30px</span><span style="color: #00AA00;">;</span>
					<span style="color: #000000; font-weight: bold;">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;">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;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#363</span><span style="color: #00AA00;">;</span>
					<span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#3c3</span><span style="color: #00AA00;">;</span>
				<span style="color: #00AA00;">&#125;</span>
&nbsp;
				<span style="color: #cc00cc;">#mainmenu</span> ul li ul<span style="color: #00AA00;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">170px</span><span style="color: #00AA00;">;</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;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</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;">clear</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>
					<span style="color: #cc00cc;">#mainmenu</span> ul li ul li<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;">#000</span><span style="color: #00AA00;">;</span>
					<span style="color: #00AA00;">&#125;</span>
						<span style="color: #cc00cc;">#mainmenu</span> ul li<span style="color: #6666ff;">.hover</span> ul li a<span style="color: #00AA00;">&#123;</span>
							<span style="color: #000000; font-weight: bold;">border-width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
							<span style="color: #000000; font-weight: bold;">border-bottom</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;">#000</span><span style="color: #00AA00;">;</span>
							<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">29px</span><span style="color: #00AA00;">;</span>
							<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
						<span style="color: #00AA00;">&#125;</span>	
	&lt;/style<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<p><img src="http://blog.subooa.com/wp-content/uploads/2009/07/style_no_js.jpg" alt="style_no_js" title="style_no_js" width="600" height="103" class="alignnone size-full wp-image-326" /></p>
<h3>Hiding the submenu</h3>
<p>Now that the menu is working and displaying as we want it to, now we need to hide the submenu by default and setup the style for the hover state.</p>
<p>Change the left value for the &#8220;#mainmenu ul li ul&#8221; class to be off the screen somewhere (we&#8217;re using -12000px here) and add a new hover class for the list item, which moves the ul back to where we just had it when the user hovers over the main menu item.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p324code6'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3246"><td class="line_numbers"><pre>40
41
42
43
44
45
46
47
48
49
50
</pre></td><td class="code" id="p324code6"><pre class="css" style="font-family:monospace;">				<span style="color: #cc00cc;">#mainmenu</span> ul li ul<span style="color: #00AA00;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">170px</span><span style="color: #00AA00;">;</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;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-12000px</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;">clear</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>
&nbsp;
					<span style="color: #cc00cc;">#mainmenu</span> ul li<span style="color: #6666ff;">.hover</span> ul<span style="color: #00AA00;">&#123;</span>
						<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
					<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>Adding the jQuery event&#8230; the fun part</h3>
<p>Up to this point, the file could run as a standalone HTML file, and with a little extra CSS could actually work in a lot of browsers, but there are many out there that don&#8217;t support using the &#8220;:hover&#8221; on list items, so we need to make use of some javascript to tell the browser to react when the user hovers over the main menu items. So first step here is to actually load the jQuery javascript:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p324code7'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3247"><td class="line_numbers"><pre>63
64
65
66
</pre></td><td class="code" id="p324code7"><pre class="javascript" style="font-family:monospace;">	<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
		jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>(The no conflict line has been added in cases where people may already be calling a javascript file that makes use of $, it prevents us from running into any javascript code conflicts)</p>
<p>And now here is where the magic happens, using jQuery you can &#8216;chain&#8217; function calls one after the other without having to do each function call on an element on its own line which cuts down the file size and keeps things neat and together.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p324code8'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3248"><td class="line_numbers"><pre>64
65
66
67
68
69
70
71
72
73
74
75
</pre></td><td class="code" id="p324code8"><pre class="javascript" style="font-family:monospace;">	<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
		jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		jQuery<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>
			jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mainmenu'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">mouseenter</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>
				jQuery<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;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hover'</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: #660066;">mouseleave</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>
				jQuery<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;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hover'</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>
&nbsp;
	<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Finally, just to top things off we need to add some hover colors to the menu items.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p324code9'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3249"><td class="line_numbers"><pre>63
64
65
66
67
68
69
</pre></td><td class="code" id="p324code9"><pre class="css" style="font-family:monospace;">&nbsp;
				<span style="color: #cc00cc;">#mainmenu</span> ul li<span style="color: #6666ff;">.hover</span> a<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;">#3c3</span><span style="color: #00AA00;">;</span>
				<span style="color: #00AA00;">&#125;</span>
				<span style="color: #cc00cc;">#mainmenu</span> ul li ul li<span style="color: #6666ff;">.hover</span> a<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;">#333</span><span style="color: #00AA00;">;</span>
				<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://blog.subooa.com/wp-content/uploads/2009/07/final_dropdown_menu.jpg" alt="final_dropdown_menu" title="final_dropdown_menu" width="600" height="103" class="alignnone size-full wp-image-327" /></p>
<p>And that&#8217;s it, a fully functional CSS dropdown using jQuery. In a later article, I&#8217;ll cover adding a slight animation and also adding multiple levels of dropdowns.</p>
<h3>Demo and full code</h3>
<p>Here&#8217;s the running demo &#8211; <a href="http://blog.subooa.com/example/css_jquery_dropdown.html">http://blog.subooa.com/example/css_jquery_dropdown.html</a><br />
In case you got a little lost along the way, you can download the full code here to play with &#8211; <a href="http://blog.subooa.com/example/css_jquery_dropdown.zip">css_jquery_dropdown.zip</a></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/&amp;title=Creating+a+Dropdown+Menu+with+jQuery+and+CSS" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/&amp;title=Creating+a+Dropdown+Menu+with+jQuery+and+CSS" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/&amp;title=Creating+a+Dropdown+Menu+with+jQuery+and+CSS&amp;desc=I%20often%20see%20requests%20for%20help%20on%20how%20to%20create%20a%20simple%20dropdown%20menu%20without%20requiring%20too%20much%20effort%2C%20and%20usually%20I%20direct%20people%20to%20an%20article%20for%20%27son%20of%20suckerfish%27%2C%20but%20since%20jQuery%20is%20in%20most%20sites%20I%20use%20now%20I%20have%20moved%20to%20using%20a%20jQuery%20based%20dropdown%20that%20is%20much%20simpler." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/&amp;title=Creating+a+Dropdown+Menu+with+jQuery+and+CSS" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/&amp;title=Creating+a+Dropdown+Menu+with+jQuery+and+CSS" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Creating+a+Dropdown+Menu+with+jQuery+and+CSS+-+http://bit.ly/2hGvd9&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fhtml_and_css%2Fcreating-a-dropdown-menu-with-jquery-and-css%2F","http:\/\/twitter.com\/home?status=Creating+a+Dropdown+Menu+with+jQuery+and+CSS+-+http:\/\/bit.ly\/2hGvd9&amp;source=shareaholic"];var wordpress_toolbar_url = "";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2Jsb2cuc3Vib29hLmNvbS9kZXZlbG9wbWVudC9odG1sX2FuZF9jc3MvY3JlYXRpbmctYS1kcm9wZG93bi1tZW51LXdpdGgtanF1ZXJ5LWFuZC1jc3MvPHdwdGI%2BQ3JlYXRpbmcgYSBEcm9wZG93biBNZW51IHdpdGggalF1ZXJ5IGFuZCBDU1M8d3B0Yj5odHRwOi8vYmxvZy5zdWJvb2EuY29tPHdwdGI%2BU3Vib29hIFN0dWRpb3MgQmxvZw%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://blog.subooa.com/development/html_and_css/creating-a-dropdown-menu-with-jquery-and-css/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ajax in Joomla with jQuery</title>
		<link>http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/</link>
		<comments>http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 07:11:36 +0000</pubDate>
		<dc:creator>Chris Duell</dc:creator>
				<category><![CDATA[Ajax & Javascript]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://blog.subooa.com/?p=308</guid>
		<description><![CDATA[Sometimes you need Joomla to give you nothing but the components output. No template, no styling, nothing. Just the output. This article shows you how to do this, and tie it in with an Ajax call.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fjoomla-coding%2Fajax-in-joomla-with-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fjoomla-coding%2Fajax-in-joomla-with-jquery%2F&amp;source=duellsy&amp;style=normal&amp;service=bit.ly&amp;hashtags=ajax,component,joomla,jquery" height="61" width="50" /><br />
			</a>
		</div>
<p>This article came about while I was building a custom Joomla component at work, the component required a multi step form that stayed on the same page. So data needed to be grabbed from the database and displayed on the screen as the user was filling in the form.</p>
<p>I wont go into the details of making a custom component as that is outside the scope of this article, more information on that can be found <a href="http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1">here</a>, instead we&#8217;ll just grab an article assuming that it belongs to a menu and has the Itemid of 10 (you can call absolutely any component you like, as long as you know the non SEF link to the page you are after).</p>
<p>First of all we need to load jQuery, we&#8217;ll load this from Googles server to reduce the load on our own server</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p308code10'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p30810"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p308code10"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>We&#8217;ll also need to setup a new file in the /templates/system/ folder called barebones.php that will be called when we make our Ajax calls instead of the normal template so that the data returned doesn&#8217;t include the main template, css, javascript etc. Create the file, and enter in the following:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p308code11'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p30811"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p308code11"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
 * @copyright	Copyright (C) 2009 subooa.com. All rights reserved.
 * @license	GNU/GPL, see LICENSE.php
 * @author	Chris Duell (subooa.com)
 * barebones is a stripped template by subooa. 
 */</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// no direct access</span>
<a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'_JEXEC'</span> <span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Restricted access'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>jdoc<span style="color: #339933;">:</span><span style="color: #b1b100;">include</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;component&quot;</span> <span style="color: #339933;">/&gt;</span></pre></td></tr></table></div>

<p>Now to making the Ajax call, you will need a place to put the data once it is loaded, so create a div with the id of &#8220;ajax_here&#8221;.</p>
<p>Using jQuery, the Ajax call is pretty striaght forward:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p308code12'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p30812"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p308code12"><pre class="javascript" style="font-family:monospace;">jQuery<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>
	jQuery.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		type<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;GET&quot;</span><span style="color: #339933;">,</span>
		url<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;index.php&quot;</span><span style="color: #339933;">,</span>
		data<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;?Itemid=10&amp;tmpl=barebones&quot;</span><span style="color: #339933;">,</span>
		success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>html<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#ajax_here&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>html<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Quickly stepping through this, we are making a call to index.php and requesting the article associated with Itemid 10, and after the data is received adding it to the div that we created earlier that has the id of &#8220;ajax_here&#8221;. But most importantly, we explicitly call the &#8220;barebones&#8221; template so the data returned and entered into the div is ONLY the output for the component, nothing more.</p>
<p>I highly recommend using <a href="http://getfirebug.com/">Firebug </a>as you are developing and testing this so that you can see if the Ajax calls are being correctly made, and the expected results are being returned. </p>
<p>This article is quite basic on purpose, however if you would like more information just leave a comment.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/&amp;title=Ajax+in+Joomla+with+jQuery" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/&amp;title=Ajax+in+Joomla+with+jQuery" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/&amp;title=Ajax+in+Joomla+with+jQuery&amp;desc=Sometimes%20you%20need%20Joomla%20to%20give%20you%20nothing%20but%20the%20components%20output.%20No%20template%2C%20no%20styling%2C%20nothing.%20Just%20the%20output.%20This%20article%20shows%20you%20how%20to%20do%20this%2C%20and%20tie%20it%20in%20with%20an%20Ajax%20call." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/&amp;title=Ajax+in+Joomla+with+jQuery" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/&amp;title=Ajax+in+Joomla+with+jQuery" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Ajax+in+Joomla+with+jQuery+-+http://bit.ly/2kkmFb&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fjoomla-coding%2Fajax-in-joomla-with-jquery%2F","http:\/\/docs.joomla.org\/Developing_a_Model-View-Controller_Component_-_Part_1","http:\/\/getfirebug.com\/","http:\/\/twitter.com\/home?status=Ajax+in+Joomla+with+jQuery+-+http:\/\/bit.ly\/2kkmFb&amp;source=shareaholic"];var wordpress_toolbar_url = "";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2Jsb2cuc3Vib29hLmNvbS9kZXZlbG9wbWVudC9qb29tbGEtY29kaW5nL2FqYXgtaW4tam9vbWxhLXdpdGgtanF1ZXJ5Lzx3cHRiPkFqYXggaW4gSm9vbWxhIHdpdGggalF1ZXJ5PHdwdGI%2BaHR0cDovL2Jsb2cuc3Vib29hLmNvbTx3cHRiPlN1Ym9vYSBTdHVkaW9zIEJsb2c%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://blog.subooa.com/development/joomla-coding/ajax-in-joomla-with-jquery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Adding Rounded Corners Easily with Javascript</title>
		<link>http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/</link>
		<comments>http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 08:08:09 +0000</pubDate>
		<dc:creator>Chris Duell</dc:creator>
				<category><![CDATA[Ajax & Javascript]]></category>
		<category><![CDATA[curcycorners]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.subooa.com/?p=284</guid>
		<description><![CDATA[A new javascript library was brought to my attention today to allow developers to very easily add rounded corners to their sites. The library, CurvyCorners is supported in all the major browsers.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fajax_and_javascript%2Fadding-rounded-corners-easil-with-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fajax_and_javascript%2Fadding-rounded-corners-easil-with-javascript%2F&amp;source=duellsy&amp;style=normal&amp;service=bit.ly&amp;hashtags=curcycorners,javascript" height="61" width="50" /><br />
			</a>
		</div>
<p>There are a few other libraries out there that allow for the creation of rounded corners, where <a href="http://www.curvycorners.net/" target="_blank">CurvyCorners</a> differs though is that it only attempts to make the corners with Javascript if the browser being used doesn&#8217;t support CSS3 (for those unaware, rounded corners is supported in CSS3, however CSS3 is not available in browsers that hold the highest market share just yet).</p>
<p>So if the user is browsing your site on say Internet Explorer 8, the normal CSS3 rounded corners will be used. If however the user is browsing your site using Internet Explorer 7, the Javascript will kick in and create the rounded corners.</p>
<p>Using CurvyCorners couldn&#8217;t be simpler, first you&#8217;ll need to obtain a copy which you can get either as a full download <a href="http://www.curvycorners.net/downloads/">here</a>, alternatively you can get the latest version from subversion from http://curvycorners.googlecode.com/svn/tags/2.0.x/stable (or if you live on the edge, the latest development code is at svn co http://curvycorners.googlecode.com/svn/trunk).</p>
<p>Once you&#8217;ve downloaded the code and placed it with your other source files for your site, and loaded it in your site as you would any other Javascript file, you&#8217;ll just need to edit your CSS file to determine which of your elements you would like to give the rounded corners to.</p>
<p>Let&#8217;s say you wanted to wrap your entire site in a rounded box, and your existing wrapping container was a div with the class &#8220;wrapper&#8221;. Simply edit your CSS declaration for the .wrapper class similar to the following</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p284code13'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p28413"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p284code13"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.wrapper</span> <span style="color: #00AA00;">&#123;</span>
-moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3ex</span><span style="color: #00AA00;">;</span>
-webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3ex</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<p>As you can probably guess, the webkit section is for CurvyCorners to pickup if the CSS3 &#8220;-moz-border-radius&#8221; isn&#8217;t supported by the browser.</p>
<p>There are a myriad of settings available for the script, along with the ability to call the script dynamically in cases where the box would be displayed as the result of an Ajax call.</p>
<p>For full instructions, check out <a title="CurvyCorners.net" href="http://www.curvycorners.net/instructions/" target="_blank">CurvyCorners.net</a><strong> </strong></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/&amp;title=Adding+Rounded+Corners+Easily+with+Javascript" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/&amp;title=Adding+Rounded+Corners+Easily+with+Javascript" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/&amp;title=Adding+Rounded+Corners+Easily+with+Javascript&amp;desc=A%20new%20javascript%20library%20was%20brought%20to%20my%20attention%20today%20to%20allow%20developers%20to%20very%20easily%20add%20rounded%20corners%20to%20their%20sites.%20The%20library%2C%20CurvyCorners%20is%20supported%20in%20all%20the%20major%20browsers." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/&amp;title=Adding+Rounded+Corners+Easily+with+Javascript" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/&amp;title=Adding+Rounded+Corners+Easily+with+Javascript" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Adding+Rounded+Corners+Easily+with+Javascript+-+http://bit.ly/3nII9y&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fblog.subooa.com%2Fdevelopment%2Fajax_and_javascript%2Fadding-rounded-corners-easil-with-javascript%2F","http:\/\/www.curvycorners.net\/","http:\/\/www.curvycorners.net\/downloads\/","http:\/\/www.curvycorners.net\/instructions\/","http:\/\/twitter.com\/home?status=Adding+Rounded+Corners+Easily+with+Javascript+-+http:\/\/bit.ly\/3nII9y&amp;source=shareaholic"];var wordpress_toolbar_url = "";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2Jsb2cuc3Vib29hLmNvbS9kZXZlbG9wbWVudC9hamF4X2FuZF9qYXZhc2NyaXB0L2FkZGluZy1yb3VuZGVkLWNvcm5lcnMtZWFzaWwtd2l0aC1qYXZhc2NyaXB0Lzx3cHRiPkFkZGluZyBSb3VuZGVkIENvcm5lcnMgRWFzaWx5IHdpdGggSmF2YXNjcmlwdDx3cHRiPmh0dHA6Ly9ibG9nLnN1Ym9vYS5jb208d3B0Yj5TdWJvb2EgU3R1ZGlvcyBCbG9n";</script>]]></content:encoded>
			<wfw:commentRss>http://blog.subooa.com/development/ajax_and_javascript/adding-rounded-corners-easil-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
