SunQuest
 
       HTML
  Home arrow HTML arrow Page 4 - Quick Web Page Menu
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Quick Web Page Menu
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2008-04-30

    Table of Contents:
  • Quick Web Page Menu
  • Strategy
  • Code continued
  • Explanation of Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Quick Web Page Menu - Explanation of Code


    (Page 4 of 4 )


    This paragraph explains what we have in the Style Sheet.

    We do not want to change the position of the body element, so we give it a relative position property. We give it a z-index of 0. The CSS class name "menu" has been given to differentiate the table from any other table you can have on your web page. The one row table for the menu has been given the background-color: Fuchsia. To make this tutorial simple, I assumed that the only DIV elements are the two DIV elements we have for drop-down menus. The DIV elements have been given the absolute position property, a z-index of 20, and a background color of fuchsia. The DIV elements are all initially made hidden (closed). The DIV elements have been given background colors so that when they are made visible (opened) the user will not see the elements behind them (the pull down menus).

    In the BODY element, we have a one row table. The two table cells of interest have the onclick event that will call the JavaScript function to make the DIV element (pull down menu) visible. When the table cell content is clicked, the function is called with the id of the corresponding DIV element passed to it.

    Now let us look at the JavaScript. There are two functions here: one to make the DIV element (pull down menu) visible and the other one to hide (close) all menus when the user clicks on the body element outside the menu. The first function hides all the pull-down menus that might be visible (opened) before making visible the menu of interest.

    The second function responds to the onclick event (hideMenus()) of the body element. The problem here is that when you click on the menu bar or on the body outside the menu, this function is called. The two Boolean variables (menuClicked and onlyBodyClick) are used to distinguish between clicking on the menu bar and clicking on the body outside the menu.

    Finishing

    If you give the above table, table cells and DIV elements sizes and then give suitable colors to your links, background of DIV and TD elements, you should have a reasonable menu which is quickly designed. Note: the colors you choose depend on the overall design and colors of you web page. I have not specified them to any great degree in order to simplify this tutorial.

    Conclusion

    The above process gives you a reasonable and quick design. If you want to design a menu for commercial purposes, you have to take details into consideration. For example, the items in the drop-down menu may form a list, with graphical bullets. You have to think about sub menus for the drop-down menus. You have to think about style and even animation. The basics, however, you already know from this article. GOOD LUCK.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · If you are looking for an approach to creating web page menus that is independent of...
     

    HTML ARTICLES

    - Building Single Row Database Forms with HTML
    - Introduction to Database Forms with HTML
    - Another Look at Animation of Geographical Ma...
    - Animation of Geographical Map Regions
    - Changing and Moving Pictures with CSS
    - Clickable Geographical Map Regions
    - Gradient Creation with the HR Element
    - Text on HTML Images: Do it Yourself
    - Custom Buttons in HTML
    - Quick Web Page Menu
    - Maximizing and Restoring HTML Images with th...
    - Maximizing and Restoring HTML Images with th...
    - Handling Hyperlinks and Images in HTML
    - Quick Start with HTML
    - HTML Tips






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway