posted 13 years ago
Hi Eric,
please find the bellow code which is working fine in IE browser but not in Mozilla.
Could you please help me on this.
<%@ page import="java.util.Hashtable"%>
<script language='javascript'>
var frX = 0,frY = 0;
var entered = false;
var subMenuEntered = false;
var noOfMenus = 0;
var sct = scl = 0;
function tblMove(frameId)
{
var ele;
hideAll();
ele = parent.document.getElementById(frameId);
ele.style.posLeft = event.clientX - event.offsetX + scl;
ele.style.posTop = (event.clientY - event.offsetY) + 22 + sct;
ele.style.visibility = 'visible';
}
function resetScrollValues(){
sct = scl = 0;
}
function hideAll() {
for (i = 0; i < noOfMenus; i++) {
ele = document.getElementById('frm' + i);
ele.style.visibility = 'hidden';
}
}
function tdMout()
{
if (event.clientY < (event.clientY - event.offsetY))
hideAll();
}
function tblMout(frameId)
{
var ele = parent.document.getElementById(frameId);
ele.style.visibility = 'hidden';
}
function move() {
if (entered && (!subMenuEntered)) {
hideAll();
entered = false;
}
}
function send(addr)
{
//location.href=addr;
if (addr != "#") {
location.href = addr;
hideAll();
}
}
</script>
<script language='javascript'>
function addMenu(frameId, reqSubMenu, subFrameId, items, addrs, subMenuIndex)
{
var doct = window.frames[frameId].document;
doct.write("<script language='javascript'>");
if (items.length > 4) {
for (i = 3; i < items.length; i++)
doct.write("var ele=parent.document.getElementById('" + frameId + "');ele.style.height=parseInt(ele.style.height);");
}
if (reqSubMenu) {
doct.write("function submenuover(anc){var ele = parent.document.getElementById('" + subFrameId + "');}");
}
doct.write("function tblmover(){var ele = parent.document.getElementById('" + frameId + "');ele.style.visibility='visible';}");
if (reqSubMenu) {
doct.write("function norlover(anc){var ele = parent.document.getElementById('" + subFrameId + "');parent.subMenuEntered=false;ele.style.visibility='hidden';anc.style.backgroundColor='7fb7db';parent.entered=true;}");
}
else
{
doct.write("function norlover(anc){parent.subMenuEntered=false;anc.style.backgroundColor='7fb7db';parent.entered=true;}");
}
doct.write("function norlmout(anc){anc.style.backgroundColor='0071b9';}");
if (reqSubMenu) {
doct.write("function mout(anc){var ele = parent.document.getElementById('" + subFrameId + "');norlmout(anc);}");
}
doct.write("</" + "script>");
doct.write("<BODY leftmargin='0' topmargin='0' STYLE='background-color:0071b9' oncontextmenu='return false;' >")
doct.write("<table border='1' cellspacing='0' STYLE='border-Style:thin;border-top-color: #FFFFFF' onmouseover='tblmover();'>")
for (i = 0; i < items.length; i++) {
if ((reqSubMenu) && ((subMenuIndex - 1) == i)) {
if (addrs[i] == "#")
doct.write("<tr ><td STYLE='border-bottom-color:#FFFFFF;border-left-color:#FFFFFF;border-right-color:#FFFFFF;'><A onClick=parent.send('" + addrs[i] + "') style='background-color:0071b9;font-Family:Arial;font-size:11px;text-decoration:none;border-Style:none;border-Width:1px;border-color:#FFFFFF;width:150px;height:25px;color:white;line-height:20px' onmouseover='submenuover(this);' onmouseout='mout(this);'> " + items[i] + "</A></td></tr>");
else
doct.write("<tr ><td STYLE='border-bottom-color:#FFFFFF;border-left-color:#FFFFFF;border-right-color:#FFFFFF;'><A href='#' onClick=parent.send('" + addrs[i] + "') style='background-color:0071b9;font-Family:Arial;font-size:11px;text-decoration:none;border-Style:none;border-Width:1px;border-color:#FFFFFF;width:150px;height:25px;color:white;line-height:20px' onmouseover='submenuover(this);' onmouseout='mout(this);'> " + items[i] + "</A></td></tr>");
}
else {
if (addrs[i] == "#")
doct.write("<tr ><td STYLE='border-bottom-color:#FFFFFF;border-left-color:#FFFFFF;border-right-color:#FFFFFF;'><A onClick=parent.send('" + addrs[i] + "') style='background-color:0071b9;font-Family:Arial;font-size:11px;text-decoration:none;border-Style:none;border-Width:1px;border-color:#FFFFFF;width:150px;height:25px;color:white;line-height:20px' onmouseover='norlover(this);' onmouseout='norlmout(this);'> " + items[i] + "</A></td></tr>");
else
doct.write("<tr ><td STYLE='border-bottom-color:#FFFFFF;border-left-color:#FFFFFF;border-right-color:#FFFFFF;'><A href='#' onClick=parent.send('" + addrs[i] + "') style='background-color:0071b9;font-Family:Arial;font-size:11px;text-decoration:none;border-Style:none;border-Width:1px;border-color:#FFFFFF;width:150px;height:25px;color:white;line-height:20px' onmouseover='norlover(this);' onmouseout='norlmout(this);'> " + items[i] + "</A></td></tr>");
}
}
doct.write("</table>");
}
document.write("<table id='menuTable' width='100%' height='25' border='0' cellpadding='0' cellspacing='0' bgcolor='#0071b9' align='center'>");
document.write("<tr><td width='100%'>");
document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0' align='left'>");
document.write("<tr width='100%' >");
document.write("<td id='OMG' width='7%' nowrap height='25' onmouseover='tblMove(\"frm0\");' onmouseout='tdMout();' style='border : solid; border-width : 0.2px; border-bottom-color : CB7813; border-left-color : CB7813; border-right-color : CB7813; border-top-color : CB7813;'>");
document.write("<font color='#FFFFFF' FACE='Arial' SIZE=2> Resume </font></td>");
document.write("<td><img align='center' src='images/Rarrow.gif'></td>");
document.write("<td> </td>");
document.write("<td id='employee' width='10%' nowrap height='25' style='border : solid; border-width : 0.2px; border-bottom-color : #FFFFFF; border-left-color : #FFFFFF; border-right-color : #FFFFFF; border-top-color : #FFFFFF;'>");
document.write("<font color='#FFFFFF' FACE='Arial' SIZE=2> </font></td>");
document.write("<td id='project' width='7%' nowrap height='25' style='border : solid; border-width : 0.2px; border-bottom-color : #FFFFFF; border-left-color : #FFFFFF; border-right-color : #FFFFFF; border-top-color : #FFFFFF;'>");
document.write("<font color='#FFFFFF' FACE='Arial' SIZE=2> </font></td>");
document.write("<td> </td>");
document.write("<td> </td>");
document.write("<td> </td>");
document.write("<td align='right' width='10%'><a href= 'logout.do' ><font color='#FFFFFF' FACE='Arial' SIZE=2>Logout</font></a> </td>");
document.write("</tr></table></td><td width='10%' align='center' ></td> </tr></table>");
document.write("<IFRAME src='' id='frm0' scrolling='no' frameborder='0' style='width:156;height:60;position:absolute;visibility:hidden;'>");
document.write("</IFRAME>");
</script>
<script language='javascript'>
var items = new Array();
var addrs = new Array();
</script>
<script language='javascript'>
items = new Array();
addrs = new Array();
items[0] = "Resume Creation";
items[1] = "Access Resume";
addrs[0] = "resumeUpload.do?methodcall=display"
addrs[1] = "managerSkillRating.do?methodcall=display"
addMenu("frm0", false, null, items, addrs, -1);
noOfMenus = document.frames.length;
document.write("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' onMouseMove='move();' onscroll='sct=document.body.scrollTop;scl=document.body.scrollLeft;' onresize='if(document.body.scrollTop==0)sct=0;if(document.body.scrollLeft==0)scl=0;'>");
</script>
Thanks
Konda Reddy