Results 1 to 3 of 3

Thread: Resizeable IFrame?

  1. #1
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Resizeable IFrame?

    I am not too sure how to explain, seems really simple in my mind
    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 . And just make it's source Google.com if you are making it.

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

  2. #2
    Join Date
    Feb 2007
    Posts
    293
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Try this:
    Code:
    <!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>

  3. #3
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks
    Rocks,

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •