HTML
  Home arrow HTML arrow Completing the React Function of a Common ...
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

Completing the React Function of a Common Browser Menu
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-04-24

    Table of Contents:
  • Completing the React Function of a Common Browser Menu
  • Explanation of the Seventh Code Segment
  • Explanation of the Seventh Code Segment Continued
  • Cleaning Up for Previous Sub Menus

  • 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


    Completing the React Function of a Common Browser Menu


    (Page 1 of 4 )

    In this eighth part of a ten-part series on building a common browser menu, we treat the last code segment of the react() function. This is the last part of the in-depth analysis we are making of the react() function.

    The Seventh Code Segment Details

    When you click the drop down button, the whole table is cleaned up. This means that all of the SPAN elements are replaced by the SPAN elements in the Copy Table. Recall that the SPAN elements in the Copy Table are in their original state where the value of the Display property is "none." When you click the drop down button, everything is recopied and we can say the table is cleaned up. This cleaning is done by the dropDownMenu() function.

    However, when a sub menu appears, any other sub menu of the same level has to disappear; from what we have explained so far, the SPAN elements for the previous sub menus are not cleaned up. It is the seventh code segment that does this. This is the segment:


    //Cleanup removes SPAN elements that are not supposed to be shown, resulting from sub menus.

    //get the row no. and col. no. of the current cell ID

    cellrowNo = "" + tdID.charAt(2);

    cellColNo = "" + tdID.charAt(3);

    //get the number of the current SPAN element displayed

    spanNo = document.getElementById('TNo').rows[cellrowNo].cells[cellColNo].innerHTML;


    //scan the whole table and clear elements that are not supposed to be shown

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

    {

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

    {

    otherSpanNo = document.getElementById('TNo').rows[i].cells[j].innerHTML;

    if (otherSpanNo.length > spanNo.length)

    {

    beginslice = 0;

    endslice = spanNo.length;

    slicedStr = otherSpanNo.slice(beginslice,endslice);

    if (slicedStr != spanNo)

    {

    //form the IDs of sub menu and backup cells

    IDCell = "TD" + i + j;

    tdIDBack = 'TDB' + i + j;

    //reset the cell content

    document.getElementById(IDCell).innerHTML = document.getElementById(tdIDBack).innerHTML;

    //also reset the background

    document.getElementById(IDCell).style.background = "transparent";

    //reset the Boolean and SPAN number tables as well

    document.getElementById('TB').rows[i].cells[j].innerHTML = "";

    document.getElementById('TNo').rows[i].cells[j].innerHTML = "";

    }

    }

    }

    }


    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Hello HTML 5, Goodbye Gears
    - 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







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