Results 1 to 2 of 2

Thread: Drop Down Document Viewer--pull up pictures?

  1. #1
    Join Date
    Jul 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drop Down Document Viewer--pull up pictures?

    1) Script Title:
    Drop-Down Document Viewer

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...opdownview.htm

    3) Describe problem:
    How can I make this pull up jpg. photos instead of html files? I have tried several different ways and nothing seems to work.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    </head>
    <body>
    <form name="jumpy">
    <select name="example" size="1" onChange="gone()">
    <!-- CHANGE THE BELOW URLS TO YOUR OWN-->
    <option value="photo1.jpg" selected>Yahoo.com</option>
    <option value="photo2.jpg">Google</option>
    <option value="photo2.jpg">Lycos</option>
    <option value="photo4.jpg">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=0
    //if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
    var iframecode='<iframe id="external" style="width:95%;height:400px" src="photo1.jpg"></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>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •