HTML
  Home arrow HTML arrow Page 4 - 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 - The Matching


    (Page 4 of 4 )

    The next statement after the above (FTN) is an if-statement. The condition of this if-statement tests for the matching (if (FTN == rootArr[j])). Note that for each iteration of the spanArr array, FTN is developed. The rest of the statements are inside this if-block. If the test (comparison) matches, then the statements in the block are executed.

    The first statement inside this block forms the ID of the cell over which the mouse pointer is hovering. The statement following is an if-statement. This if-statement verifies if we are dealing with the cell that triggered the onmouseover event by testing if its background color is firebrick. Any statement of the sixth code segment that still has to be executed is inside this if-block. Now the previous statement and this if-statement are for convenience. If matching has already occurred, you do not really need these two statements.

    Next you have a for-loop. It is this for-loop that actually displays the sub menu. The for-loop iterates through the indices 0 to 4. These five numbers are for the five cells in a column that we have. A sub menu is made up of SPAN elements in consecutive cells in a table column. Not all the cells in the column have to be involved.

    Do not confuse the for-loop here with the two for loops above. This one iterates through the length of the column, while the other two iterate through the lengths of their respective arrays. Also, the other two have all the statements of the sixth code segment. The one here has the statements to produce the sub menu. This one iterates through a column, and in some consecutive cells it displays SPAN elements. Of course, before it does that, other preparations have been done outside it, within the segment.

    The first statement in this for-loop forms the ID for the cell at the iteration. Recall that the digits of the numbers sent for the spanArr do not include the last two. The next statement forms the ID of the SPAN element that might be in the cell. It does this by adding the row and column numbers for that cell to the matched SPAN number. It then precedes the result with "S."

    A sub menu does not necessarily have SPAN elements in all the cells of a column. As we iterate though the column, we form a SPAN ID for each cell in the column. The element for that ID may not exist. Before anything else, we have to check if the element exists. This is what the next if-statement does. If the test returns true, then the statements in this if-block are executed.

    The first statement in this if-block turns the background color of the cell to brown. The next statement displays the SPAN element. The statement following, sets the content of the corresponding cell in the Boolean Table to true. The next statement forms the SPAN ID number of the SPAN element just displayed. For this statement, the expression on the right hand side of the assignment (=) symbol begins with “”. This makes sure the result is a string. The number form here is complete and includes the last two digits. The last line writes this number into the corresponding cell of the Number Table.

    I have finished with the detailed explanation for the sixth code segment. I'll see you in the next part of the series.


    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

    - 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