shumway
11-07-2003, 09:40 AM
Ive spent almost 20 hours on this now and I just cant figure it out.
I have this script containing several iframes. (I have simplified it and deleted all but one here.):
<html>
<head>
<script language="JavaScript1.1" type="text/javascript">
function WindowZoom( module )
{
// This doesnt work!!!
// document.getElementById( module ).document.getElementById('DivBorderBR').style.left = 100;
//But this works!!!
Games.document.getElementById('DivBorderBR').style.left = 100;
alert( document.getElementById( module ).id ); //Gives "Games"
alert( Games.id ); //Gives undefined
}
</script>
</head>
<body>
<iframe id="Games" style="position:absolute; left:200; top:200; width:600; height:400px; z-index:1; border:0px #FFFFFF" src="Games.htm" frameborder="1" scrolling="no"></iframe>
</body>
</html>
Games.htm looks like this:
<html>
<body>
<form method=post name="GamesForm" action="">
<img src="../../lib/images/DivGames.gif" class="DivHeader" onClick="parent.window.WindowZoom('Games')" style="position: absolute; left: 3; top: 120">
<img id="DivBorderTL" src="DivBorderTL.bmp" style="position: absolute; left: 0; top: 0;" width="109" height="109">
<img id="DivBorderTR" src="DivBorderTR.bmp" style="position: absolute; left: 396; top: 0;" width="109" height="109">
<img id="DivBorderBL" src="DivBorderBL.bmp" style="position: absolute; left: 0; top: 156;" width="109" height="109">
<img id="DivBorderBR" src="DivBorderBR.bmp" style="position: absolute; left: 396; top: 156;" width="109" height="109">
</form>
</body>
</html>
Pliiiiiiiiiiiiiiiiiiiiiiiiizzze somebody help me!!!!!!!!!!!!!!!!!!!
Why doesnt ...
document.getElementById( module ).document.getElementById('DivBorderBR').style.left = 100;
...work when...
Games.document.getElementById('DivBorderBR').style.left = 100;
...does?????
I have this script containing several iframes. (I have simplified it and deleted all but one here.):
<html>
<head>
<script language="JavaScript1.1" type="text/javascript">
function WindowZoom( module )
{
// This doesnt work!!!
// document.getElementById( module ).document.getElementById('DivBorderBR').style.left = 100;
//But this works!!!
Games.document.getElementById('DivBorderBR').style.left = 100;
alert( document.getElementById( module ).id ); //Gives "Games"
alert( Games.id ); //Gives undefined
}
</script>
</head>
<body>
<iframe id="Games" style="position:absolute; left:200; top:200; width:600; height:400px; z-index:1; border:0px #FFFFFF" src="Games.htm" frameborder="1" scrolling="no"></iframe>
</body>
</html>
Games.htm looks like this:
<html>
<body>
<form method=post name="GamesForm" action="">
<img src="../../lib/images/DivGames.gif" class="DivHeader" onClick="parent.window.WindowZoom('Games')" style="position: absolute; left: 3; top: 120">
<img id="DivBorderTL" src="DivBorderTL.bmp" style="position: absolute; left: 0; top: 0;" width="109" height="109">
<img id="DivBorderTR" src="DivBorderTR.bmp" style="position: absolute; left: 396; top: 0;" width="109" height="109">
<img id="DivBorderBL" src="DivBorderBL.bmp" style="position: absolute; left: 0; top: 156;" width="109" height="109">
<img id="DivBorderBR" src="DivBorderBR.bmp" style="position: absolute; left: 396; top: 156;" width="109" height="109">
</form>
</body>
</html>
Pliiiiiiiiiiiiiiiiiiiiiiiiizzze somebody help me!!!!!!!!!!!!!!!!!!!
Why doesnt ...
document.getElementById( module ).document.getElementById('DivBorderBR').style.left = 100;
...work when...
Games.document.getElementById('DivBorderBR').style.left = 100;
...does?????