HTML
  Home arrow HTML arrow Drop Down Functions for a Common Browser M...
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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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

Drop Down Functions for a Common Browser Menu
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-03-27

    Table of Contents:
  • Drop Down Functions for a Common Browser Menu
  • The Third Segment of the dropDownMenu() Function
  • The Third Segment of the dropDownMenu() Function Continued
  • The react() Function

  • 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


    Drop Down Functions for a Common Browser Menu


    (Page 1 of 4 )

    In this part of the series, we continue with the JavaScript for the main menu and its sub menus. We will first complete the explanation of the second code segment of the dropDownMenu(ID) function, and then introduce a new feature with it.

    Second Code Segment of the dropDownMenu(ID) Function Continued

    There are actually three tables whose value for the display property is "none." The first one we talked about is the Copy Table. The second one is called the Boolean Table. It has the same structure as our table of interest. Its cells are initially empty. For any cell in our table of interest that has a SPAN element displayed, the corresponding cell content in the Boolean table is "true." In this way we can always know which cell in our table has a SPAN element displayed.

    The third table whose value for the display property is "none" has the same structure as our table. The table is called the Number Table. For any cell in our table of interest that has a SPAN element displayed, the corresponding cell of the Number Table is given the number part of the ID of the SPAN element displayed. There can be more than one SPAN element in a cell in our table, but only one of these SPAN elements can be displayed at any time. We use this third table to know which SPAN element is displayed in which cell of our table. These two tables and their roles are the new features I mentioned above.

    You may ask why I did not use a JavaScript two-dimensional array for each of these three tables. There are two reasons: A) JavaScript 2D arrays still need to be well-developed. B) After going though this series, you may want to create a template which would make it easy for any novice to use your code. You would want the novice, without knowing what your code is doing, to type in the number of rows and columns, and then your code will create the tables. Today, this kind of thing is better done with an HTML table than with the JavaScript 2D array. DOM has properties that you can use to create rows and cells.

    The aim of the second segment in the dropDownMenu() function is to clear our table of interest. If you clear what is displayed in our table, you have to clear the related contents in the Boolean and Number Tables. The last two statements in the if-block of this segment do that. Note: the Copy table is never cleared. 

    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek