Home arrow HTML arrow Page 2 - Making a Common Browser Menu React
HTML

Making a Common Browser Menu React


Welcome to the fifth part of a ten-part series that shows you how to make a drop-down browser menu that works on multiple browsers. In this part of the series, we begin an in-depth analysis of the react() function, which is the function that responds to the onmouseover event for each table cell.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
April 03, 2009
TABLE OF CONTENTS:
  1. · Making a Common Browser Menu React
  2. · Third Code Segment of the react() Function
  3. · Details of the react() Function
  4. · The Fourth Code Segment: Details

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Making a Common Browser Menu React - Third Code Segment of the react() Function
(Page 2 of 4 )

The Third Code Segment

The second segment turns all the background colors of the cells to brown. This segment turns the background color of whatever cell the mouse pointer is on to firebrick. These two segments handle the problem of making the present color firebrick and the previous one brown.

The Fourth Code Segment

This segment clears all the cells in the column whose SPAN elements are not supposed to be displayed. In other words, it clears all the cells in the column that are not supposed to have a brown background color. In order to do the clearing, the code does not change the value of the display property of the SPAN element from "block" to "none." It copies the SPAN elements in their initial state (‘none’) from the Copy Table to the corresponding cells that are to be cleared in our table.

The Fifth Code Segment

This segment handles the case where a sub menu has to appear from the menu dropped down by the Drop Down Button. You, the designer, have to know which cell has a SPAN element with the ‘>’ character. The attribute of a button that requires a sub menu is:


onmouseover="react('TD11',['11'],'2','')"


The first argument is the ID of the cell having the SPAN element. The second argument is an array. It has the number part of the ID of the SPAN element that has the ‘>’ character. The third argument is the column number for the sub menu to be developed. This should be the next column on the right. However, if the drop down column is the last column, then this number should be the number of the previous column. This segment needs these three arguments in order to produce the sub menu by the side of the drop down menu.

The Sixth Code Segment

The last code segment produces a sub menu from a drop down menu. This segment produces a sub menu from a previous sub menu (like the one produced above). The attribute of a button that requires such a lower sub menu is:


onmouseover="react('TD22',['1122'],'3',['11'])"


The first three arguments have been described above. The last one is an array. It has the number part of the ID of the cell that gave rise to the present sub menu. Note that each of these array elements can have more than one entry. This segment uses the elements of the two arrays to know which SPAN elements to display in the lower sub menu. We shall see the details later.

The Seventh Code Segment

The seventh segment is outside the if-statement. This segment clears the cells displaying SPAN elements that are not supposed to be displayed. It uses the Number Table for this. There are many times when this segment goes into effect but does not change anything. We shall see the details later.


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 3 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials