Home arrow HTML arrow Page 3 - Choosing Sub Menus for a Common Browser Menu
HTML

Choosing Sub Menus for a Common Browser Menu


In this part of the series, we discuss how the sub menus, including drop-down menus, are removed from the screen. We shall also see how the series will progress. This is the ninth part of a ten-part series covering the creation of a common browser menu.

Author Info:
By: Chrysanthus Forcha
Rating:  stars stars stars stars stars / 0
May 01, 2009
TABLE OF CONTENTS:
  1. · Choosing Sub Menus for a Common Browser Menu
  2. · The removeSubMenu() Function
  3. · The Statements in the for-loops
  4. · Some Comments

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Choosing Sub Menus for a Common Browser Menu - The Statements in the for-loops
(Page 3 of 4 )

At a particular iteration, the first statement in the inner for-loop gets the value of the Boolean variable (if it is there) of the corresponding cell in the Boolean Table, and assigns it to the boolVar variable. The second statement gets the SPAN number (if it is there) from the corresponding cell in the Number Table.

The next statement is an if-statement. It verifies if a SPAN element is displayed in the cell of the iteration. It does this by checking to see if boolVar is equal to “true.” If the condition is true, then the statements in the if-block are executed.

This block cleans the table cell at the iteration. The first statement in the block forms the ID of the Table Cell at the iteration.

The next statement forms the ID of the SPAN element that has to be replaced by the original copied version. The statement after that makes the copy.

The following two statements sets the content of the corresponding cells in the Boolean and Number Tables respectively to “”.

Now the subMenuJustClicked global variable should only be true if you have just clicked a sub menu item; otherwise, it should always be false. When the variable is true, the sub menus are not “removed.” Before the function ends, this variable is set to false.

In this way, when next the BODY element receives a click, the function will remove the sub menus, unless a sub menu item was clicked as well. The if-test “if (subMenuJustClicked == false)” checks this.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials