Home arrow HTML arrow Page 3 - Quick Web Page Menu
HTML

Quick Web Page Menu


Many applications (e.g. Microsoft Word) have a menu as their first bar. If you have a web site that has many pages, you can create a similar menu bar where, if you click a menu item, a drop-down menu with links will appear over other content on the page. You might have seen this on some web pages already. Keep reading if you would like to learn how to build this for your web site.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 8
April 30, 2008
TABLE OF CONTENTS:
  1. · Quick Web Page Menu
  2. · Strategy
  3. · Code continued
  4. · Explanation of Code

print this article
SEARCH DEVARTICLES

Quick Web Page Menu - Code continued
(Page 3 of 4 )

menuClicked = true;

onlyBodyClicked = true;

}

 

function hideMenus()

{

if ((onlyBodyClicked == true)&&(menuClicked == false))

{

document.getElementById("D1").style.visibility = "hidden";

document.getElementById("D2").style.visibility = "hidden";

 

}

//reset the menuClicked flag

menuClicked = false;

}

</script>


</head>


<body onclick="hideMenus()">

<table class="menu">

<tr>

<td onclick="showHideMenu('D1')">

Pull Down First Menu <br />

<div id="D1" style="visibility:hidden">

<a href = "http://www.website.com">First Link </a><br />

<a href = "http://www.website.com">Second Link</a><br />

<a href = "http://www.website.com">Third Link</a><br />

<a href = "http://www.website.com">Fourth Link</a>

</div>

</td>

<td>

&nbsp;

</td>

<td onclick="showHideMenu('D2')">

Pull Down Second Menu <br />

<div id="D2" style="visibility:hidden">

<a href = "http://www.website.com">First Link </a><br />

<a href = "http://www.website.com">Second Link</a><br />

<a href = "http://www.website.com">Third Link</a><br />

<a href = "http://www.website.com">Fourth Link</a>

</div>

</td>

</tr>

</table>


Many elements will go here. This can include Paragraphs, links tables, etc.

</body>


</html>


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials