More on the React Function for a Common Browser Menu
Welcome to the sixth part of a ten-part series on building a common browser menu. We continue in this part with the in-depth analysis of the react() function. As you may recall, in the last part we noted that the function was composed of five code segments, and began analyzing them. In this part, we shall complete the details of the react() function's fourth code segment and talk about the fifth code segment.
More on the React Function for a Common Browser Menu - The Fifth Code Segment Details (Page 2 of 4 )
This segment does not do anything to the menu that is dropped down by clicking the drop down button. A sub menu simply displays the SPAN elements of certain cells in a column; it also changes the background colors of these cells to brown. Consider the following attribute in a sub menu table cell:
onmouseover="react('TD31','','','')"
The name of the react() function with its parameters is:
react(tdID,spanArr,subColNo,rootArr)
The call in the above attribute sends only the ID of the cell the attribute is in. For the other three arguments, an empty string, ‘’ is sent. These three parameters are used with sub menus. When the react() function receives a call with these three arguments empty, it does nothing to a sub menu that is developed from a drop down menu.
The fifth code segment produces a sub menu directly from a drop down menu cell. You, the designer, have to know the cell that has a SPAN element with a ‘>’ character requires a sub menu from the present cell (in the drop down menu). In this case your attribute in the cell requiring a drop down menu is something like this:
onmouseover="react('TD11',['11'],'2','')"
The first argument in the call is the ID of the cell the attribute is in; you, the designer, have to know this as you are designing. The second argument is an array. The array here has only one element. This element is the number part of the ID of the SPAN element that has the ‘>’ character; you, the designer, have to know this.
The next argument is the column number on the side of the drop down menu. This will always be the next column on the right. If your present cell is in the drop down menu that is the last column, then this number should be the number of the last but one column, since the new sub menu has to be produced on the left. The last argument is an empty string. This last parameter (argument) is needed when you want a sub menu of a lower level.