forums
You are not logged in.
can I change the size a frame dynamically.
Offline
If you want to change the size of a frame with the help of JavaScript, the answer is no. You can, however, change the size of IFRAMEs in some browsers like IE/Win.
Offline
thanx for the reply ... so the iframe's size can be changed dynamically..plz can u show me a sample of how to do it......
Offline
Here's an example that will probably work in all modern browsers (although I have only tested it in IE6, Opera 7 and Netscape 6):
<!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" xml:lang="en" lang="en">
<head>
<title>SmartMenus example</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<script type="text/javascript">
<!--
function changeIframeSize(){
if(!document.getElementById)
return;
var iframeObject=document.getElementById('myIframe');
var iframeObjectStyle=iframeObject.style;
iframeObjectStyle.width='300px';
iframeObjectStyle.height='300px';
}
//-->
</script>
</head>
<body onload="changeIframeSize()">
<iframe id="myIframe" src="http://www.yahoo.com/" style="width:200px;height:200px;"></iframe>
</body>
</html>The iframe's size will be changed onload.
Offline
thanx for the reply.. and the code.. this is goin to help me a lot man.. thanx.catch ya soon.
Offline