Hi there...I'm using some proprietary software and I'm not a Javascript guru by any stretch. In the HTML page we've got a <TABLE> and one row <TR> has a text link "Menu Options". When the user clicks on this, a drop down menu appears (which I believe is contained in a <SPAN>. If you click anywhere else, the drop down menu disappears.
The problem is that a few <TR>'s down from "Menu Options" there is a <SELECT> input. When the user clicks "Menu Options" to open the <SPAN> menu, the <SELECT> that is a few rows down in the underlying table, shows up on top of the menu, partially hiding some of the options in the "Menu Options" menu.
Here is the code for the drop down menu contained in a cell:
<td class="mainmenuitems">
<ilayer height=14>
<layer visibility=show>
<span class=mainmenu onClick="dropit2 dropmenu0);event.cancelBubble=true;return false">
<a class=mainmenu href=alternate.htm onclick="if(document.layers) return dropit(event, 'document.dropmenu0')">Menu Options</a>
</span>
</layer>
</ilayer>
</td>
A few rows down, there is the <SELECT>:
<td class="catcells">
<nobr>
<select name="category" tabindex="4" class="formentry">
<option value="*" selected>all categories
<option value="COMP">Compensation Surveys
<option value="FOOD">LOMA's Grocery Store
<option value="RSCH">Research Reports
</select>
<input type="submit" value="Go" align="center" valign="middle" class="formentry">
</nobr>
</td>
So, the "Menu Options" <a> reference uses two Javascript functions: dropit and dropit2. Here is the code for those:
var zindex=100
function dropit2(whichone) {
if (window.themenu&&themenu.id!=whichone.id)
themenu.style.visibility="hidden"
themenu=whichone
if (document.all) {
themenu.style.left=document.body.scrollLeft+event.clientX-event.offsetX
themenu.style.top=document.body.scrollTop+event.clientY-event.offsetY+18
if (themenu.style.visibility=="hidden"
{
themenu.style.visibility="visible"
themenu.style.zIndex=zindex++
}
else {
hidemenu()
}
}
}
function dropit(e,whichone) {
if (window.themenu&&themenu.id!=eval(whichone).id)
themenu.visibility="hide"
themenu=eval(whichone)
if (themenu.visibility=="hide"
themenu.visibility="show"
else
themenu.visibility="hide"
themenu.zIndex++
themenu.left=e.pageX-e.layerX
themenu.top=e.pageY-e.layerY+19
return false
}
If anyone can please offer a solution to preventing the <SELECT> from showing up underneath the "Menu Options" menu, I'd appreciate it. The software company that generated this product has not researched the matter nor do they plan on it.
Thanks,
Andrew
The problem is that a few <TR>'s down from "Menu Options" there is a <SELECT> input. When the user clicks "Menu Options" to open the <SPAN> menu, the <SELECT> that is a few rows down in the underlying table, shows up on top of the menu, partially hiding some of the options in the "Menu Options" menu.
Here is the code for the drop down menu contained in a cell:
<td class="mainmenuitems">
<ilayer height=14>
<layer visibility=show>
<span class=mainmenu onClick="dropit2 dropmenu0);event.cancelBubble=true;return false">
<a class=mainmenu href=alternate.htm onclick="if(document.layers) return dropit(event, 'document.dropmenu0')">Menu Options</a>
</span>
</layer>
</ilayer>
</td>
A few rows down, there is the <SELECT>:
<td class="catcells">
<nobr>
<select name="category" tabindex="4" class="formentry">
<option value="*" selected>all categories
<option value="COMP">Compensation Surveys
<option value="FOOD">LOMA's Grocery Store
<option value="RSCH">Research Reports
</select>
<input type="submit" value="Go" align="center" valign="middle" class="formentry">
</nobr>
</td>
So, the "Menu Options" <a> reference uses two Javascript functions: dropit and dropit2. Here is the code for those:
var zindex=100
function dropit2(whichone) {
if (window.themenu&&themenu.id!=whichone.id)
themenu.style.visibility="hidden"
themenu=whichone
if (document.all) {
themenu.style.left=document.body.scrollLeft+event.clientX-event.offsetX
themenu.style.top=document.body.scrollTop+event.clientY-event.offsetY+18
if (themenu.style.visibility=="hidden"
themenu.style.visibility="visible"
themenu.style.zIndex=zindex++
}
else {
hidemenu()
}
}
}
function dropit(e,whichone) {
if (window.themenu&&themenu.id!=eval(whichone).id)
themenu.visibility="hide"
themenu=eval(whichone)
if (themenu.visibility=="hide"
themenu.visibility="show"
else
themenu.visibility="hide"
themenu.zIndex++
themenu.left=e.pageX-e.layerX
themenu.top=e.pageY-e.layerY+19
return false
}
If anyone can please offer a solution to preventing the <SELECT> from showing up underneath the "Menu Options" menu, I'd appreciate it. The software company that generated this product has not researched the matter nor do they plan on it.
Thanks,
Andrew