HTML
  Home arrow HTML arrow Producing Sub Menus 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

Producing Sub Menus for a Common Browser Menu
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-04-17

    Table of Contents:
  • Producing Sub Menus for a Common Browser Menu
  • More Description of the Sixth Code Segment
  • The Statements of the Sixth Code Segment
  • The Matching

  • 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


    Producing Sub Menus for a Common Browser Menu


    (Page 1 of 4 )

    In this seventh part of a ten-part series on building a menu that works in all browsers, we shall continue with our in-depth analysis of the react() function. This is the longest function in this series. In this part we shall treat the details of the sixth code segment.

    The Sixth Code Segment Details

    Before we continue, note that when the react() function is called, the program goes through all the code segments of the function. Certain parts are not executed based on an if-condition. The react() function refers either to the drop-down menus or sub menus. Also note that drop down menus are also sub menus; I make the distinction because I want to differentiate between a sub menu got to by clicking the drop-down button and a sub menu obtained when the mouse goes over a menu item.

    The fifth code segment was an if-statement. The sixth code segment is the else-if part of the fifth code segment (there is only this if-else part). The fifth code segment produces a sub menu emanating from a drop-down menu. The sixth code segment produces any sub menu after that. This is the code:


    else if ((subColNo != "")&&(rootArr != ""))

    {

    for (i=0; i < spanArr.length; i++)

    {

    for (j=0; j < rootArr.length; j++)

    {

    FTN = spanArr[i].charAt(0) + spanArr[i].charAt(1);

    if (FTN == rootArr[j])

    {

    //form the cell ID

    tdIDR = 'TD' + FTN;

    if (document.getElementById(tdIDR).style.backgroundColor == "firebrick")

    {

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

    {

    //form the TD ID

    tdIDSub = 'TD' + k + subColNo;

    //form ID of SPAN

    spanID = 'S' + spanArr[i] + k + subColNo;

    if (document.getElementById(spanID)) //if it exist

    {

    document.getElementById(tdIDSub).style.backgroundColor = "brown";

    document.getElementById(spanID).style.display = "block";

    //indicate the cell that is displayed in the boolean table

    document.getElementById('TB').rows[k].cells[subColNo].innerHTML = "true";

    //indicate the first two numbers of the shown SPAN ID in the table that shows the Nos.

    number = "" + spanArr[i] + k + subColNo;

    document.getElementById('TNo').rows[k].cells[subColNo].innerHTML = number;

    }

    }

    }

    }

    }

    }

    }


    Recall that the if-condition of the fifth code segment tests if the argument for the subColNo parameter is not “” and if the argument for the rootArr parameter is “”. Under this condition, a sub menu is to be developed from a drop-down menu. The if-condition of the code segment above tests if the subColNo is not “” and if the rootArr is not also “”. Under this condition, a sub menu has to be developed from a previous sub menu when the mouse goes over a menu item on the previous sub menu.

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