"H.A.P" <ha***@hotmail.com> writes:
I'm trying to change the size of an iframe. In the following page, how
should I do it?
<script language="javascript"
The type attribute is required, and language is deprecated:
<script type="text/javascript">
function resize_frm() {
I1.width=400;
You shouldn't access named elements as properties of the global object.
Few browsers allow that (although one of them is used quite a lot).
Either
var iframe = document.getElementsByTagName("iframe")[0];
or give the iframe an id and use document.getElementById.
To change the width, use style.width:
iframe.style.width = "400px";
Remember the unit, it is required in CSS.
<iframe name="I1" src="contents.htm" width="200" height="150">
Don't use the width and height attributes, but use CSS instead:
<iframe name="I1" id="iframe1Id" src="contents.htm"
style="width:200px;height:150px;">
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'