<?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>Code With Design &#187; menu</title>
	<atom:link href="http://codewithdesign.com/tag/menu/feed/" rel="self" type="application/rss+xml" />
	<link>http://codewithdesign.com</link>
	<description>web application development blog by Caleb Jonasson</description>
	<lastBuildDate>Thu, 15 Sep 2011 17:52:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Creating multiple sidebar menus in wordpress</title>
		<link>http://codewithdesign.com/2010/05/22/creating-multiple-sidebar-menus-in-wordpress/</link>
		<comments>http://codewithdesign.com/2010/05/22/creating-multiple-sidebar-menus-in-wordpress/#comments</comments>
		<pubDate>Sat, 22 May 2010 16:48:55 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[dynamic menus]]></category>
		<category><![CDATA[footer menu]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=403</guid>
		<description><![CDATA[Creating additional dynamic menus for a wordpress template.


Related posts:<ol><li><a href='http://codewithdesign.com/2010/09/23/adding-the-like-button-to-wordpress/' rel='bookmark' title='Permanent Link: Adding The &#8216;Like&#8217; Button to WordPress'>Adding The &#8216;Like&#8217; Button to WordPress</a></li>
<li><a href='http://codewithdesign.com/2010/01/15/creating-user-input-with-menus-in-java/' rel='bookmark' title='Permanent Link: Creating user input with menus in java'>Creating user input with menus in java</a></li>
<li><a href='http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/' rel='bookmark' title='Permanent Link: Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Creating multiple sidebar menus in wordpress" data-via="" data-url="http://codewithdesign.com/2010/05/22/creating-multiple-sidebar-menus-in-wordpress/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2010/05/22/creating-multiple-sidebar-menus-in-wordpress/"></g:plusone><p>In this tutorial I won&#8217;t just be making a sidebar menu, but three additional menus that will be placed side by side in the footer. Unfortunately the code for this is not as easy as it may seem. The possibility of creating the sidebars through only your footer.php and sidebar.php is not going to happen. Fortunately the code is very simple and involves a lot of copy and pasting with a couple modifications.</p>
<p>For this tutorial I will be using wordpress 2.9.2 (currently the latest release)</p>
<p>When creating multiple &#8220;sidebars&#8221; You only need to do two things. The first thing is to edit the functions.php page, and the second is to edit the HTML where the sidebar/dynamic menu will be placed.</p>
<p>The first thing that we will be doing is opening our functions.php page. The code for one sidebar should look like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'register_sidebar_widget'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sidebar'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cwj'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'normal_sidebar'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h2 class=&quot;widgettitle&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h2&gt;'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The next thing we will need to do is modify this code so we can have four dynamic menus throughout our WordPress theme. We will need to copy and paste the array and change out the name and the ID to something new and exciting. Because the menus will be placed in my footer I will be calling them &#8220;Footer1&#8243; etc for each menu. The ID can be anything as long as it is unique to that specific menu. If you have two menus with the same ID you will only be able to add widgets to the last referenced menu.﻿</p>
<p>The code should now look something like this:</p>

<div class="wp_syntax"><table><tr><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
31
32
33
34
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'register_sidebar_widget'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sidebar'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'CJDesign-dark1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'normal_sidebar'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h2 class=&quot;widgettitle&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h2&gt;'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Footer1'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'CJDesign-dark1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'col_sidebar1'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h2 class=&quot;widgettitle&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h2&gt;'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Footer2'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'CJDesign-dark1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'col_sidebar2'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h2 class=&quot;widgettitle&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h2&gt;'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Footer3'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'CJDesign-dark1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'col_sidebar3'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h2 class=&quot;widgettitle&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h2&gt;'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The next stage in this tutorial is to quickly and easily insert the line of code to display your newly created dynamic menus. Just place this into the HTML where you would like it to be.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Footer3'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>You simply need to replace where I have Footer3 with the name of the sidebar that you previously created with the function.</p>
<p>The sidebar now looks as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;footer-col&quot;&gt;
	&lt;ul&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Footer1'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;footer-col&quot;&gt;
	&lt;ul&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Footer2'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;footer-col&quot;&gt;
	&lt;ul&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Footer3'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/ul&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>And the widgets can be modified through the WordPress widget page.</p>
<p><a href="http://codewithdesign.com/wp-content/uploads/2010/05/Screen-shot-2010-05-22-at-9.32.17-AM.png" rel="lightbox[403]"><img class="alignnone size-medium wp-image-405" title="Widget page showing 3 footer menus" src="http://codewithdesign.com/wp-content/uploads/2010/05/Screen-shot-2010-05-22-at-9.32.17-AM-600x378.png" alt="&lt;img&gt;" width="600" height="378" /></a></p>
<p>And the final product.</p>
<p><a href="http://codewithdesign.com/wp-content/uploads/2010/05/Screen-shot-2010-05-22-at-9.31.58-AM.png" rel="lightbox[403]"><img class="alignnone size-medium wp-image-404" title="Wordpress 3 sidebar footer" src="http://codewithdesign.com/wp-content/uploads/2010/05/Screen-shot-2010-05-22-at-9.31.58-AM-600x172.png" alt="&lt;img&gt;" width="600" height="172" /></a></p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=403&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://codewithdesign.com/2010/09/23/adding-the-like-button-to-wordpress/' rel='bookmark' title='Permanent Link: Adding The &#8216;Like&#8217; Button to WordPress'>Adding The &#8216;Like&#8217; Button to WordPress</a></li>
<li><a href='http://codewithdesign.com/2010/01/15/creating-user-input-with-menus-in-java/' rel='bookmark' title='Permanent Link: Creating user input with menus in java'>Creating user input with menus in java</a></li>
<li><a href='http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/' rel='bookmark' title='Permanent Link: Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2010/05/22/creating-multiple-sidebar-menus-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating user input with menus in java</title>
		<link>http://codewithdesign.com/2010/01/15/creating-user-input-with-menus-in-java/</link>
		<comments>http://codewithdesign.com/2010/01/15/creating-user-input-with-menus-in-java/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 03:40:45 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[scanner]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=245</guid>
		<description><![CDATA[TweetWhen working with console command lines in java I found myself needing a solution that works when in certain situations. The console was a java based game and the need was user input because the game was being built in a text style format. In this article I will be using &#8216;equalsIgnoreCase();&#8217; to match a [...]


Related posts:<ol><li><a href='http://codewithdesign.com/2010/01/17/create-a-press-enter-to-continue-with-java/' rel='bookmark' title='Permanent Link: Create a press enter to continue with java'>Create a press enter to continue with java</a></li>
<li><a href='http://codewithdesign.com/2010/03/28/java-pass-as-many-strings-as-you-want-through-a-method/' rel='bookmark' title='Permanent Link: Java: Pass as many strings as you want through a method'>Java: Pass as many strings as you want through a method</a></li>
<li><a href='http://codewithdesign.com/2009/12/08/java-basic-for-and-while-loops/' rel='bookmark' title='Permanent Link: Java: basic for and while loops'>Java: basic for and while loops</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Creating user input with menus in java" data-via="" data-url="http://codewithdesign.com/2010/01/15/creating-user-input-with-menus-in-java/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2010/01/15/creating-user-input-with-menus-in-java/"></g:plusone><p>When working with console command lines in java I found myself needing a solution that works when in certain situations. The console was a java based game and the need was user input because the game was being built in a text style format.</p>
<p>In this article I will be using &#8216;equalsIgnoreCase();&#8217; to match a string with what I would like it to be. I will also be using the &#8216;Scanner&#8217; class, keyboard inputs, and String objects. Here is the code that I will be working with&#8230;</p>

<div class="wp_syntax"><table><tr><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
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Scanner</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> userInputWithMenus <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
Scanner keyboard <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Scanner<span style="color: #009900;">&#40;</span><span style="color: #003399;">System</span>.<span style="color: #006633;">in</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;1. Menu.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;2. Item.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;3. Close.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399;">String</span> inp <span style="color: #339933;">=</span> keyboard.<span style="color: #006633;">nextLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inp.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> inp.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;main&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//execute what happens on main.</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inp.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;2&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> inp.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;item&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//execute what happens on item</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inp.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> inp.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;exit&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//execute what happens on close</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The first thing we do is import a class that is built into java. Here we can access the scanner and assign a variable to it. Once we have our main class and main method setup we will display our menu and request the next line of text from the user and load this into the string &#8216;inp.&#8217; The next block of code is the If else statements normally you would execute another method or run the program from this point on however that was not what I intended on covering here.</p>
<p>Inside of the if else blocks..</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I placed code that matched the string contents with what I needed it to; in this case the menu items. I didn&#8217;t want the user to be forced into typing menu, item or exit so I made an or statement using &#8216;||&#8217; to introduce the option of matching the string with the numbers. This is all done with a line that looks as follows.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">inp.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;main&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> inp.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>You can just use &#8216;imp.equals();&#8217; however I in creating this some copying and pasting was done. To get your menu to work even better you can try putting it into a loop and breaking the loop when the user enters a valid command. This can be easily done with a boolean and a while loop.</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=245&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://codewithdesign.com/2010/01/17/create-a-press-enter-to-continue-with-java/' rel='bookmark' title='Permanent Link: Create a press enter to continue with java'>Create a press enter to continue with java</a></li>
<li><a href='http://codewithdesign.com/2010/03/28/java-pass-as-many-strings-as-you-want-through-a-method/' rel='bookmark' title='Permanent Link: Java: Pass as many strings as you want through a method'>Java: Pass as many strings as you want through a method</a></li>
<li><a href='http://codewithdesign.com/2009/12/08/java-basic-for-and-while-loops/' rel='bookmark' title='Permanent Link: Java: basic for and while loops'>Java: basic for and while loops</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2010/01/15/creating-user-input-with-menus-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Hoirzontal Menu</title>
		<link>http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/</link>
		<comments>http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 08:31:53 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[drop down menu bar]]></category>
		<category><![CDATA[horizontal]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Spry]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=77</guid>
		<description><![CDATA[Tweet In order to create a proper working javascript based horizontal menu you need to have all of the necessary files. These files consist of : /SpryAssets/SpryMenuBarHorizontal.css /SpryAssets/SpryMenuBar.js index.php main.css The first section of code is going to be the SpryMenuBarHorizontal.css 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [...]


Related posts:<ol><li><a href='http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Permanent Link: Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
<li><a href='http://codewithdesign.com/2011/05/19/javascript-settimeout-firing-immediately/' rel='bookmark' title='Permanent Link: JavaScript: setTimeout Firing Immediately'>JavaScript: setTimeout Firing Immediately</a></li>
<li><a href='http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/' rel='bookmark' title='Permanent Link: Modifying next and previous posts'>Modifying next and previous posts</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Javascript Hoirzontal Menu" data-via="" data-url="http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/"></g:plusone><p><a href="http://codewithdesign.com/pages/java_header_test_1/index.php"><img class="alignnone size-full wp-image-78" title="javascript_horizontal_menu" src="http://codewithdesign.com/wp-content/uploads/2009/10/javascript_horizontal_menu.jpg" alt="javascript_horizontal_menu" width="592" height="108" /></a></p>
<p>In order to create a proper working javascript based horizontal menu you need to have all of the necessary files. These files consist of :</p>
<p>/SpryAssets/SpryMenuBarHorizontal.css<br />
/SpryAssets/SpryMenuBar.js</p>
<p>index.php<br />
main.css</p>
<p>The first section of code is going to be the SpryMenuBarHorizontal.css</p>

<div class="wp_syntax"><table><tr><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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@charset &quot;UTF-8&quot;;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span>
<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-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</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;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">default</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarActive</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</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-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</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;">100%</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;">text-align</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;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8em</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>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul
<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-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</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;">100%</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;">1020</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">default</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8.2em</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;">-1000em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul<span style="color: #6666ff;">.MenuBarSubmenuVisible</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul li
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8.2em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul ul
<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;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-5%</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">95%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul<span style="color: #6666ff;">.MenuBarSubmenuVisible</span> ul<span style="color: #6666ff;">.MenuBarSubmenuVisible</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul
<span style="color: #00AA00;">&#123;</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: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> 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;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</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;">#4b4b4b</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.2em</span> <span style="color: #933;">0.4em</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;">text-decoration</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: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #3333ff;">:focus
</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;">#4b4b4b</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: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #6666ff;">.MenuBarItemHover</span><span style="color: #00AA00;">,</span> ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #6666ff;">.MenuBarItemSubmenuHover</span><span style="color: #00AA00;">,</span> ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #6666ff;">.MenuBarSubmenuVisible</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;">#333366</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ccccff</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> iframe
<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;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1010</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #a1a100;">@media screen, projection</span>
<span style="color: #00AA00;">&#123;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> li<span style="color: #6666ff;">.MenuBarItemIE</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;">inline</span><span style="color: #00AA00;">;</span>
f\loat<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: #cc00cc;">#4b4b4b</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The second file, SpryMenuBar.js looks like this.</p>

<div class="wp_syntax"><table><tr><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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">var</span> Spry<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>Spry<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    Spry <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>Spry.<span style="color: #660066;">Widget</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    Spry.<span style="color: #660066;">Widget</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    Spry.<span style="color: #660066;">Widget</span>.<span style="color: #660066;">MenuBar</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> opts<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;">init</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> opts<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
    Spry.<span style="color: #660066;">Widget</span>.<span style="color: #660066;">MenuBar</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">init</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> opts<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: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> isie <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> document.<span style="color: #660066;">all</span> <span style="color: #339933;">!=</span> ‘undefined’ <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">typeof</span> window.<span style="color: #660066;">opera</span> <span style="color: #339933;">==</span> ‘undefined’ <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> navigator.<span style="color: #660066;">vendor</span> <span style="color: #339933;">!=</span> ‘KDE’<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: #000066; font-weight: bold;">typeof</span> document.<span style="color: #660066;">getElementById</span> <span style="color: #339933;">==</span> ‘undefined’ <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">vendor</span> <span style="color: #339933;">==</span> ‘Apple Computer<span style="color: #339933;">,</span> Inc.’ <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">typeof</span> window.<span style="color: #660066;">XMLHttpRequest</span> <span style="color: #339933;">==</span> ‘undefined’<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>isie <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">typeof</span> document.<span style="color: #660066;">uniqueID</span> <span style="color: #339933;">==</span> ‘undefined’<span style="color: #009900;">&#41;</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: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>opts<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> k <span style="color: #000066; font-weight: bold;">in</span> opts<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> rollover <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Image<span style="color: #339933;">;</span>
    rollover.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> opts<span style="color: #009900;">&#91;</span>k<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</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: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> items <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span>‘li’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    layers<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span>layers<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</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: #339933;">;</span>
&nbsp;
    Spry.<span style="color: #660066;">Widget</span>.<span style="color: #660066;">MenuBar</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">clearMenus</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>root<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> menus <span style="color: #339933;">=</span> root.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span>‘ul’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #CC0000;">0</span> <span style="color: #339933;">?</span> submenus<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> hasSubMenu <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>menu<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;">addClassName</span><span style="color: #009900;">&#40;</span>link<span style="color: #339933;">,</span> “MenuBarItemSubmenu”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    hasSubMenu <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>isie<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
    listitem.<span style="color: #660066;">contains</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>testNode<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>testNode <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</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: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>testNode <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">this</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: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">else</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;">contains</span><span style="color: #009900;">&#40;</span>testNode.<span style="color: #660066;">parentNode</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: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> self <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>listitem<span style="color: #339933;">,</span> ‘mouseover’<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;">if</span><span style="color: #009900;">&#40;</span>self.<span style="color: #660066;">bubbledTextEvent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    clearTimeout<span style="color: #009900;">&#40;</span>closetime<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>self.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">==</span> listitem<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    self.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    self.<span style="color: #660066;">addClassName</span><span style="color: #009900;">&#40;</span>link<span style="color: #339933;">,</span> hasSubMenu <span style="color: #339933;">?</span> “MenuBarItemSubmenuHover” <span style="color: #339933;">:</span> “MenuBarItemHover”<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>menu <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span>self.<span style="color: #660066;">hasClassName</span><span style="color: #009900;">&#40;</span>menu<span style="color: #339933;">,</span> “MenuBarSubmenuVisible”<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    opentime <span style="color: #339933;">=</span> window.<span style="color: #660066;">setTimeout</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>self.<span style="color: #660066;">showSubmenu</span><span style="color: #009900;">&#40;</span>menu<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: #CC0000;">250</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: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>listitem<span style="color: #339933;">,</span> ‘mouseout’<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;">if</span><span style="color: #009900;">&#40;</span>self.<span style="color: #660066;">bubbledTextEvent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> related <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> e.<span style="color: #660066;">relatedTarget</span> <span style="color: #339933;">!=</span> ‘undefined’ <span style="color: #339933;">?</span> e.<span style="color: #660066;">relatedTarget</span> <span style="color: #339933;">:</span> e.<span style="color: #660066;">toElement</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>listitem.<span style="color: #660066;">contains</span><span style="color: #009900;">&#40;</span>related<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    clearTimeout<span style="color: #009900;">&#40;</span>opentime<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    self.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">=</span> listitem<span style="color: #339933;">;</span>
&nbsp;
    self.<span style="color: #660066;">removeClassName</span><span style="color: #009900;">&#40;</span>link<span style="color: #339933;">,</span> hasSubMenu <span style="color: #339933;">?</span> “MenuBarItemSubmenuHover” <span style="color: #339933;">:</span> “MenuBarItemHover”<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>menu<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    closetime <span style="color: #339933;">=</span> window.<span style="color: #660066;">setTimeout</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>self.<span style="color: #660066;">hideSubmenu</span><span style="color: #009900;">&#40;</span>menu<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: #CC0000;">600</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;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now you need your index.php. This is where the menu content will be.</p>

<div class="wp_syntax"><table><tr><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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
&lt;html xmlns=”http://www.w3.org/1999/xhtml”&gt;
&lt;head&gt;
&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;link href=”main.css” rel=”stylesheet” type=”text/css” /&gt;
&lt;script src=”SpryAssets/SpryMenuBar.js” type=”text/javascript”&gt;&lt;/script&gt;
&lt;link href=”SpryAssets/SpryMenuBarHorizontal.css” rel=”stylesheet” type=”text/css” /&gt;
&lt;/head&gt;
&nbsp;
&lt;body&gt;
&nbsp;
&lt;div id=”container”&gt;
&lt;div id=”header”&gt;
&lt;h1&gt;Header&lt;/h1&gt;
&nbsp;
&lt;ul id=”MenuBar1″&gt;
&lt;li&gt;
&lt;div align=”center”&gt;&lt;a href=”#”&gt;simple&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div align=”center”&gt;&lt;a href=”#”&gt;Smart&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div align=”center”&gt;&lt;a href=”#”&gt;Tutorials&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=”#”&gt;Photoshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=”#”&gt;Illustrator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=”#”&gt;Flash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=”#”&gt;Dreamweaver&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;!– end #header –&gt;&lt;/div&gt;
&lt;div id=”mainContent”&gt;
&lt;h1&gt; Main Content &lt;/h1&gt;
&lt;!– end #mainContent –&gt;&lt;/div&gt;
&lt;div id=”footer”&gt;
&lt;p&gt;Footer&lt;/p&gt;
&lt;!– end #footer –&gt;&lt;/div&gt;
&lt;!– end #container –&gt;&lt;/div&gt;
&lt;script type=”text/javascript”&gt;
&lt;!–
var MenuBar1 = new Spry.Widget.MenuBar(“MenuBar1″);
//–&gt;
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>The last file that we need is the main.css file.</p>

<div class="wp_syntax"><table><tr><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
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@charset &quot;utf-8&quot;;</span>
body <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span> Verdana<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;">;</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;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#container</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;">46em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</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;">#000000</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-align</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: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#4b4b4b</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;">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>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#header</span> h1 <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: #933;">10px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#mainContent</span> <span style="color: #00AA00;">&#123;</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;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</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;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</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: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#DDDDDD</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#footer</span> p <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: #933;">10px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://codewithdesign.com/pages/java_header_test_1/index.php">Try it out by clicking here.</a></p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=77&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Permanent Link: Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
<li><a href='http://codewithdesign.com/2011/05/19/javascript-settimeout-firing-immediately/' rel='bookmark' title='Permanent Link: JavaScript: setTimeout Firing Immediately'>JavaScript: setTimeout Firing Immediately</a></li>
<li><a href='http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/' rel='bookmark' title='Permanent Link: Modifying next and previous posts'>Modifying next and previous posts</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

