Drop Down Functions for a Common Browser Menu (Page 1 of 4 )
Second Code Segment of the dropDownMenu(ID) Function Continued
There are actually three tables whose value for the display property is "none." The first one we talked about is the Copy Table. The second one is called the Boolean Table. It has the same structure as our table of interest. Its cells are initially empty. For any cell in our table of interest that has a SPAN element displayed, the corresponding cell content in the Boolean table is "true." In this way we can always know which cell in our table has a SPAN element displayed.
The third table whose value for the display property is "none" has the same structure as our table. The table is called the Number Table. For any cell in our table of interest that has a SPAN element displayed, the corresponding cell of the Number Table is given the number part of the ID of the SPAN element displayed. There can be more than one SPAN element in a cell in our table, but only one of these SPAN elements can be displayed at any time. We use this third table to know which SPAN element is displayed in which cell of our table. These two tables and their roles are the new features I mentioned above.
The aim of the second segment in the dropDownMenu() function is to clear our table of interest. If you clear what is displayed in our table, you have to clear the related contents in the Boolean and Number Tables. The last two statements in the if-block of this segment do that. Note: the Copy table is never cleared.