<?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; javascript</title>
	<atom:link href="http://itscalledwebdesign.com/tag/javascript/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>
		<item>
		<title>CSS animated hovers</title>
		<link>http://itscalledwebdesign.com/tutorials/css-animated-hovers/</link>
		<comments>http://itscalledwebdesign.com/tutorials/css-animated-hovers/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 23:35:05 +0000</pubDate>
		<dc:creator>eckert</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[hovers]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=456</guid>
		<description><![CDATA[CSS hovers, animated, no client side applications required. Too good to be true? I was looking for a way to do animated hovers, without having to use flash or javascript. Not that there is anything wrong with these, but anytime I can avoid hoping that someone will have the proper apps installed within their browser, [...]]]></description>
			<content:encoded><![CDATA[<p>CSS hovers, animated, no client side applications required.  Too good to be true?<br />
<span id="more-456"></span><br />
I was looking for a way to do animated hovers, without having to use flash or javascript.  Not that there is anything wrong with these, but anytime I can avoid hoping that someone will have the proper apps installed within their browser, I prefer to take that route.</p>
<p>So how do I do it?</p>
<p>Simple CSS and animated gifs.</p>
<p>First, make an animated gif the size of you nav button:</p>
<p>Next, a little CSS:</p>
<pre>#nav {
    height: 35px;
    width: 500px;
}

div.button {
    float: left;
    width: 100px;
    height: 35px;
    margin: 0 3px 0 0;
    background: #fff;
    border: 1px solid #000;
}

div.button a {
    display: block;
    margin: 0;
    padding:0;
    width:100%;
    height:100%;
    overflow:hidden;
    font: bold 13px Georgia, serif;
    color:#039;
    text-decoration: none;
    background: #fff;
}

div.button span {
    display: block;
    margin:0;
    padding: 9px 0 0 0;
    text-align: center;

}

div.button a:hover {
    background: url( 'http://itscalledwebdesign.com/files/gif_hover/bg03.gif' ) top center no-repeat;
    color: yellow;
}</pre>
<p>Next, the following div is placed:</p>
<pre>&lt;div id="nav"&gt;
    &lt;div class="button"&gt;&lt;a href="#"&gt;&lt;span&gt;Nav 1&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
    &lt;div class="button"&gt;&lt;a href="#"&gt;&lt;span&gt;Nav 2&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
    &lt;div class="button"&gt;&lt;a href="#"&gt;&lt;span&gt;Nav 3&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<p>You are pretty much just making a div and placing the animated gif as the image for the hover.  In this example, the &#8220;a&#8221; simply has a white background.</p>
<p><a href="http://itscalledwebdesign.com/files/gif_hover/">CLICK HERE</a> to see how it looks, it&#8217;s the &#8220;Fast&#8221; example.</p>
<p>View the CSS and source of that example page to see that the other examples are set up using the same code.  You just need to use different animated GIFs as the hover image.</p>
<p>One thing you need to think about is the possibility that animations are turned off on the users computer.  The only problem this might cause will be if you have your hovered text turn into the same color as the original background.  That would then cause the text to disappear.</p>
<p>I would suggest trying it with the animation turned on and off just to see what it would look like.</p>
<p>So there you have it.  Simple, quick CSS animated hovers.</p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/css-animated-hovers/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

