This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with iframe in mozilla browser

 
Konda Anki
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

IFrame is not displaying in mozilla broser. Find the bellow code.



Could you please tell me what changes need to be done in the above code.

Thanks in advance
Konda Reddy
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well visibility:hidden is telling me you want it hidden. lol

also your width and height are unitless. 89 what? pixels, miles, cm, ems, km, etc.

Eric
 
Konda Anki
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric for your replay,

visibility:hidden - First time when the page is loading, visibility should be hidden, thats way i used visibility:hidden . I change this hidden to visible based on the user action.

width and height are in pixel.



 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well your code does not say it is in pixel.

Are you sure that your JavaScript code is correct that does the show/hide? I am guessing it is not, but I have no clue since my crystal ball is in the shop so I can not magically see your code.

Eric
 
Konda Anki
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

The same code is working fine in IE browser.

Is there any dependency on IE browser for iframe and why the same code behaves differently in both Mozilla & IE browsers.

Thanks
Konda Reddy
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want help, we need to see code so I can answer why they act differently.

Eric
 
Konda Anki
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic