Hello everyone,
I encountered a problem while trying to create a sitepage with a dropdown menu and an iframe.
The options in the menu must load in the iframe.
I need the iframe in this page to resize it's height to the size of the page that loads in it.
The current 3 pages that have to load in the iframe all have different heights.
Hopefully someone can help me with this.
This is the html :
Can anyone please help me solve this?
Thanks a lot in advance for your help!
I encountered a problem while trying to create a sitepage with a dropdown menu and an iframe.
The options in the menu must load in the iframe.
I need the iframe in this page to resize it's height to the size of the page that loads in it.
The current 3 pages that have to load in the iframe all have different heights.
Hopefully someone can help me with this.
This is the html :
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My Website</title>
<script type="text/javascript">
function SetIFrame()
{
myFrm = document.getElementById('myIFrame');
myFrm.src = document.mapform.jump.options[document.mapform.jump.selectedIndex].value;
}
</script>
<script>
function alertsize(pixels){
pixels+=32;
document.getElementById('myIFrame').style.height=pixels+"px";
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#5C5457" link="000000" vlink="000000" alink="000000">
<div align="center">
<table width="70%" border="1" bordercolor="#333333">
<tr>
<td>
<div align="center">
<br />
<br />
<form name="mapform" method="post">
<p>
<br />
<select name="jump" size="1">
<option value="http://www.mydomain.com/products1.html">Products part 1</option>
<option value="http://www.mydomain.com/products2.html">Products part 2</option>
<option value="http://www.mydomain.com/products3.html">Products part 3</option>
<option value="" selected="selected">select</option>
</select>
<input type=button onclick="SetIFrame()" value="Go" />
</p>
</form>
<div align="center">
<iframe id="myIFrame" name="Frame1" width="1045" src="http://www.mydomain.com/main.html" frameborder="0" scrolling="no" body onload="parent.alertsize(document.body.scrollHeight);"></iframe>
</div>
<br />
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
Can anyone please help me solve this?
Thanks a lot in advance for your help!
Last edited by a moderator:







