HTML
  Home arrow HTML arrow Page 3 - Scripting a Common Browser Menu
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

Scripting a Common Browser Menu
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-03-20

    Table of Contents:
  • Scripting a Common Browser Menu
  • The Skeleton of the dropDownMenu() Function
  • The Second Code Segment
  • The dropDownMenu() 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


    Scripting a Common Browser Menu - The Second Code Segment


    (Page 3 of 4 )

    When you click a drop down menu to have a sub menu, any sub menus (sub menu with its own sub menus) have to be removed from the screen. This segment does that. I explain how in the next few paragraphs.

    There is another table, which has the same structure, number of rows and columns as our table of interest (that displays the sub menus). When our table of interest is first shown, it does not display any sub menu. In fact, it is completely transparent; we made it that way. No SPAN element is seen because the initial value of the display property of each SPAN element is "none."

    Our table of interest is above the elements of the page in its DIV element. The DIV element is also transparent, so you see the elements of normal flow on the page. Copies of elements in our table of interest under this initial state are made in the other table. I call this other table the Copy Table. Elements (the SPAN elements) in our table under this state are not seen because of the value "none."

    When you have a sub menu in our table of interest, it means the state (CSS) of some SPAN elements in our table has been changed. In order to clear our table of interest, the SPAN elements in our table are replaced by copies from the other table. These copies are always in their initial state. This is the purpose of the second segment; I will give more details later. The other table is not seen in the web page because the value of its display property is "none."

    Now, you may ask, “Why do we have all of this complication and even a second table? Why not just put SPAN or simply A elements in rows and columns in a DIV element?” Before I answer that question, know that there are two more tables, with the same structure as our table of interest. This is the answer: if you try that, your code may work in one browser and not work in the other two major browsers for which we're trying to build. The aim of this series is to come out with a common code.

    The Third Code Segment

    This SPAN elements or their exact copies are always in our table of interest. When a SPAN element is not seen, the value if its display property is "none." If you want a SPAN element to be seen, you change the value of its display property to "block." This segment uses the ID of the drop down button clicked to know the ID of which SPAN element to display (show).

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