<?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>It's Called Web Design &#187; down</title>
	<atom:link href="http://itscalledwebdesign.com/tag/down/feed/" rel="self" type="application/rss+xml" />
	<link>http://itscalledwebdesign.com</link>
	<description>Web 2.0 is so 2004. . . .</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:59:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Easy Dropdown Navigation</title>
		<link>http://itscalledwebdesign.com/tutorials/easy-dropdown-navigation/</link>
		<comments>http://itscalledwebdesign.com/tutorials/easy-dropdown-navigation/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 15:59:24 +0000</pubDate>
		<dc:creator>eckert</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[down]]></category>
		<category><![CDATA[drop]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[navigation]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=615</guid>
		<description><![CDATA[Here&#8217;s how to get dropdowns in your navigation. First, you are going to need this bit of code in your &#60;head&#62; &#60;script type="text/javascript"&#62;&#60;!--//--&#62;&#60;![CDATA[//&#62;&#60;!-- sfHover = function() {     if (!document.getElementsByTagName) return false;     var sfEls = document.getElementById("nav").getElementsByTagName("li");     for (var i=0; i&#60;sfEls.length; i++) {         sfEls[i].onmouseover=function() {             this.className+=" sfhover";         [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how to get dropdowns in your navigation.<br />
<span id="more-615"></span>First, you are going to need this bit of code in your &lt;head&gt;</p>
<pre>&lt;script type="text/javascript"&gt;&lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!--
sfHover = function() {
    if (!document.getElementsByTagName) return false;
    var sfEls = document.getElementById("nav").getElementsByTagName("li");

    for (var i=0; i&lt;sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover";
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }

}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--&gt;&lt;!]]&gt;&lt;/script&gt;</pre>
<p>Next, you are going to to set up the navigation.  Check out the example code, then read the description of what it means below:</p>
<pre>&lt;div id="catnav"&gt;
  &lt;div id="nav"&gt;

  &lt;ul&gt;
    &lt;li&gt;&lt;a href="http://yourdomain.com/"&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;

  &lt;ul&gt;
    &lt;li&gt;&lt;a href="http://yourdomain.com/page1/"&gt;Page One&lt;/a&gt;
     &lt;ul&gt;
      &lt;li&gt;&lt;a href="http://yourdomain.com/page1sub1/"&gt;Page One Sub One&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="http://yourdomain.com/page1sub2/"&gt;Page One Sub Two&lt;/a&gt;&lt;/li&gt;
     &lt;/ul&gt;
    &lt;/li&gt;
  &lt;/ul&gt;

  &lt;ul&gt;
    &lt;li&gt;&lt;a href="http://yourdomain.com/page2/"&gt;Page Two&lt;/a&gt;
     &lt;ul&gt;
      &lt;li&gt;&lt;a href="http://yourdomain.com/page2sub1/"&gt;Page Two Sub One&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="http://yourdomain.com/page2sub2/"&gt;Page Two Sub Two&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="http://yourdomain.com/page2sub1/"&gt;Page Two Sub Three&lt;/a&gt;&lt;/li&gt;
     &lt;/ul&gt;
    &lt;/li&gt;
  &lt;/ul&gt;

  &lt;/div&gt;
&lt;/div&gt;</pre>
<p>The first HOME link has no dropdown, just the initial link.  The next cluster has a main link and then 2 sub pages in the dropdown and the last one has three sub links.</p>
<p>You can modify the link paths and how many dropdown sub links that you require.  Just make really sure that the first part of the code cluster starts with an &lt;li&gt;, but the ending &lt;/li&gt; doesn&#8217;t come until the bottom of the cluster.  This has screwed me over a couple of times and I&#8217;ll save you the trouble.</p>
<p>The last thing you will need is the CSS.</p>
<pre>#catnav {
  	padding: 0;
  	clear: both;
 	height: 32px;
 	width: 1000px;
 	background: #000;
  	position: absolute;
  	top: 85px;
        z-index: 100;
}

#nav {
  	list-style: none;
  	margin: 0;
  	padding: 0;
	position: relative;
	z-index: 100;
}

#nav ul {
  	margin: 0;
  	padding: 0;
}

#nav li {
  	float: left;
 	margin: 0;
 	padding: 0;
	list-style: none;
}

#nav a {
  	display: block;
  	line-height: 32px;
 	margin: 0 20px;
  	padding: 0;
  	font-size: 14px;
  	color: #fff;
	font-weight: bold;
}

#nav li a:hover {
  	color: #fff;
  	text-decoration: underline;
  	display: block;
}

#nav li ul {
  	list-style: none;
  	position: absolute;
  	width: 150px;
  	left: -999em;
}

#nav li:hover ul, #nav li.sfhover ul {
  	left: auto;
}

#nav li li {
  	float: left;
  	margin: 0;
  	padding: 0;
 	width: 129px;
}

#nav li li a {
 	width: 129px;
  	height: 24px;
  	line-height: 24px;
  	color: #000;
  	border-bottom: 1px solid #000;
  	background: #c5c5c5;
  	margin: 0;
  	padding: 5px 20px 5px 15px;
}

#nav li li a:hover {
  	border-top: 1px solid #131f27;
  	background: #000;
  	padding: 5px 20px 5px 15px;
}

#nav li:hover, #nav li.sfhover { /* prevents IE7 drop-down menu bug (focus on a page element prevents nested menus from disappearing) */
  	position: static;
}</pre>
<p>Obviously, you can and will modify this to make it fit for your site, but this should get you started.</p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/easy-dropdown-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

