Log in

View Full Version : Resizeable IFrame?



Moglizorz
06-04-2007, 07:50 PM
I am not too sure how to explain, seems really simple in my mind :p
I'm sure I've seen this script before. Well, here goes:


I have an IFrame.
It's default height should be "0" pixels.
I want an image below it, that when clicked, will resize the IFrames height to "150" pixels.
And another image next to that, when clicked also, will resize the IFrame back to "0" pixels.


If anyone can see a script to do this, that would be awesome. Also, if anyone decides to make the script, just do textual links, changing it to images isn't that hard :p. And just make it's source Google.com if you are making it.

I hope someone out there knows how to do this...
Thanks.

Veronica
06-04-2007, 09:27 PM
Try this:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<script language="JavaScript" type="text/javascript">

function ReSize(id,h){
var obj=document.getElementById(id);
obj.style.height=h+'px';
}

</script>
</head>

<body>
<span id="Link1" onclick="ReSize('myframe',150);" >change to 150</span>

<span id="Link2" onclick="ReSize('myframe',0);" >back to 0</span><br>


<br>
<iframe id="myframe" src="http://www.google.com" width="500" height="0"></iframe>
</body>

</html>

Moglizorz
06-05-2007, 08:12 PM
Thanks :D
Rocks, :)