HTML
  Home arrow HTML arrow Page 5 - Functions for a Menu for All Browsers
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

Functions for a Menu for All Browsers
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-06-03

    Table of Contents:
  • Functions for a Menu for All Browsers
  • Names of the Functions and their Roles
  • The dropDownMenu() Function Details
  • The remove3NumID() Function Details
  • The remove2NumID() Function Details

  • 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


    Functions for a Menu for All Browsers - The remove2NumID() Function Details


    (Page 5 of 5 )

    The remove2NumID() function removes any sub menu whose number part of the table ID is made up of two digits. This is the function:


    function remove2NumID()

    {

    for (i=0;i<5;i++)

    {

    for (j=0;j<5;j++)

    {

    //form ID

    theID = 'ST' + i + j;

    if (document.getElementById(theID))

    {

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

    document.getElementById(theID).style.display = "none";

    }

    }

    }


    remove3NumID()

    }



    This function is called only under special circumstances. There are two for-loops. Each for-loop is for one digit. Each for-loop iterates from the index number zero to the index number 4. These five iterations are for the maximum of five menu items that our example can have for a sub menu. All of the statements are in the innermost for-loop.

    IDs of all possible two-digit combinations for our example are formed as the program goes through the two for-loops, from index zero to 4. The first statement in the inner for-loop forms the ID. The next statement first checks if that ID exists (for our example).

    If it does, then two statements are executed. The first of the two statements gives a value of "hidden" to the visibility property of the corresponding table. The second statement removes the table by giving the value of "none" to the display property of the table.

    The first statement (hidden) is not really necessary. However, if you do not have it, Internet Explorer may not remove the table. The other browsers do not need the statement.

    Now, notice that before the end of this function, the remove3NumID() function is called. The remove2NumID() function is normally called when you want to remove tables whose number parts are made up of two or three digits. So after the tables whose number parts are made up of two digits are removed, the remove3NumID() function is called to remove the tables whose number parts are made up of three digits.

    Note this: if you have sub menus of lower levels (four digit number parts, five digits, etc.) then you would need functions such as remove4NumID(), remove5NumID(), etc. for removing the corresponding tables. The remove4NumID() function will have four for-loops, remove5NumID() will have five for-loops, etc.

    Let us take a break here. We continue in the next part with the react() function.


    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.

     

    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 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek