Results 1 to 3 of 3

Thread: auto resize??

  1. #1
    Join Date
    Sep 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default auto resize??

    I have used the following script form DD for some time now and it is very useful for my purposes. The script offers the option of opening new links in an inline frame. How may the script be modified (in-line mode) to simply auto resize??

    Thanks!



    <form name="jumpy">
    <select name="example" size="1" onChange="gone()">
    <!-- CHANGE THE BELOW URLS TO YOUR OWN-->
    <option value="http://www.yahoo.com" selected>Yahoo.com</option>
    <option value="http://www.google.com">Google</option>
    <option value="http://www.lycos.com">Lycos</option>
    <option value="http://www.AltaVista.com">AltaVista</option>
    </select>

    <input type="button" name="test" value="Go!" onClick="gone()">
    </form>

    <script language="javascript">
    <!--

    //Drop-down Document Viewer- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, 100's more DHTML scripts, and TOS,
    //visit http://www.dynamicdrive.com

    //Specify display mode (0 or 1)
    //0 causes document to be displayed in an inline frame, while 1 in a new browser window
    var displaymode=1
    //if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
    var iframecode='<iframe id="external" style="width:95%;height:400px" src="http://www.yahoo.com"></iframe>'

    /////NO NEED TO EDIT BELOW HERE////////////

    if (displaymode==0)
    document.write(iframecode)

    function gone(){
    var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
    if (document.getElementById&&displaymode==0)
    document.getElementById("external").src=selectedurl
    else if (document.all&&displaymode==0)
    document.all.external.src=selectedurl
    else{
    if (!window.win2||win2.closed)
    win2=window.open(selectedurl)
    //else if win2 already exists
    else{
    win2.location=selectedurl
    win2.focus()
    }
    }
    }
    //-->
    </script>

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

    Default

    If you're looking for a script to re-size the iframe to fit the page you're pulling into it, it will only work if the content of the iframe and the iframe itself are on the same server. (I'm not sure if the yahoo, google, etc links are the ones you're actually using or if that's just for demo)
    So long as they are on the same server, you can incorporate the script here: http://www.dynamicdrive.com/dynamici...iframessi2.htm

  3. #3
    Join Date
    Sep 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Veronica, I will give this a good try!

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
  •