//flex table opened by JP

Click to See Complete Forum and Search --> : PHP Problem or Javascript?


rraehal
11-25-2003, 07:05 PM
I am trying to make a menu appear above two drop down boxes.

Attached is a picture of the problem.

I am using PHP to fill in the required information from the template. I can not figure out how to make the javascript menu appear at the front of my web page. Please see the next post for the template and Java code.

rraehal
11-25-2003, 07:09 PM
In the template i use the following line to draw my drop down boxes/form:
<form name="monthYear">
<td align="right">
<? monthPullDown($m, $lang['months']); yearPullDown($y); ?>
<input type="button" value="GO" onClick="submitMonthYear()">
</td>
</form>

This is the only place my menus appear below the drop down boxes. Could you please help me determine how I might move the menus above the layer where the dropdown boxes are drawn.

Each menu is drawn like this:
<div id=dropmenu3 style="position:absolute;left:0;top:0;layer-background-color:#E5E3CE;background-color:#E5E3CE;width:160;visibility:hidden;border:1 px solid black;padding:0px">
<script language="JavaScript1.2">
if (document.all)
dropmenu3.style.padding="4px"
for (i=0;i<menu4.length;i++)
document.write(menu4[i])
</script>
</div>
<script language="JavaScript1.2">
if (document.layers){
document.dropmenu3.captureEvents(Event.CLICK)
document.dropmenu3.onclick=hidemenu
}
</script>

Here is the function to drop menus:
function dropit(e,whichone){
curmenuID=ns6? document.getElementById(whichone).id : eval(whichone).id
if (window.themenu&&themenu.id!=curmenuID)
themenuStyle.visibility=ns4?"hide" : "hidden"

themenu=ns6? document.getElementById(whichone): eval(whichone)
themenuStyle=(ns6||ie4)? themenu.style : themenu

themenuoffsetX=(ie4&&opr==-1)? document.body.scrollLeft : 0
themenuoffsetY=(ie4&&opr==-1)? document.body.scrollTop : 0

themenuStyle.left=ns6||ns4? e.pageX-e.layerX : themenuoffsetX+event.clientX-event.offsetX
themenuStyle.top=ns6||ns4? e.pageY-e.layerY+19 : themenuoffsetY+event.clientY-event.offsetY+18

hiddenconst=(ns6||ie4)? "hidden" : "hide"
if (themenuStyle.visibility==hiddenconst){
themenuStyle.visibility=(ns6||ie4)? "visible" : "show"
themenuStyle.zIndex=zindex++
}
else
hidemenu()
return false
}

I call them like this:
<span class=wrap2 onMouseOver="dropit(event, 'dropmenu0');event.cancelBubble=true;return false" onClick="dropit(event, 'dropmenu0');event.cancelBubble=true;return false"><a href="alternate.htm" onClick="if(ns4) return dropit(event, 'document.dropmenu0')"><IMG SRC="../images/site.gif" WIDTH=108 HEIGHT=21 BORDER=0 ALT=""></a>

Thanks

neverwhere
12-04-2003, 01:42 PM
This is the only place my menus appear below the drop down boxes. Could you please help me determine how I might move the menus above the layer where the dropdown boxes are drawn.if you want to move them below/above, you could use divs/css for positioning .. i noticed you had div id=dropmenu3 style="position:absolute;left:0;top:0;layer-background-color:#E5E3CE;background-just change the positioning.. try changing it to relative or move the top to a higher value or something... could be wrong, but it seems like you just want to move the thing around on it.

rraehal
12-16-2003, 05:53 PM
I will play with the DIV and the CSS to see if I can move the menu. I simply want the menus to appear above everything. Modifying the z-index of items has not worked.

I will give you the result when I have the chance.