Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question need a Drop Down image display menu

    I am trying to find code for a page to display images using input selected in a drop down on the same page. I will try to create an example here:


    {image a displayed}

    [dropdown selecting image a]


    ---------------------------------------------------------

    {image b displayed}

    [dropdown selecting image b]



    ----------------------------------------------------------

    and so on...


    I plan to have multiple images on the screen in sort of a mosaic depending on what is selected in the drop down. Can someone help with this?

  • #2
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok this article: http://wsabstract.com/script/cut173.shtml is EXACTLY what I need... HOWEVER.... it doesn't work for multiple applications on the same page. Is there some way to make this code work many times on the same page???

    please help!

  • #3
    Regular Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    223
    Thanks
    0
    Thanked 14 Times in 14 Posts
    Does this help?

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
     <head>
      <title> New Document </title>
    <script type="text/javascript">
    <!--
    function showimage(selectList, target)
    {
     if (document.images){
      return document.images[target].src=selectList.options[selectList.selectedIndex].value
     }
    }
    //-->
    </script>
     </head>
     <body>
    <form name="mygallery">
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <select name="picture" size="1" onChange="showimage(this, 'pictures')">
     <option selected value="me.gif">Picture of me</option>
     <option value="myaunt.gif">Picture of my aunt</option>
     <option value="brother.gif">Picture of my brother</option>
    </select>
    </td>
    <td>
    <select name="picture1" size="1" onChange="showimage(this, 'pictures1')">
     <option selected value="me.gif">Picture of me</option>
     <option value="myaunt.gif">Picture of my aunt</option>
     <option value="brother.gif">Picture of my brother</option>
    </select>
    </td>
    </tr>
    <tr>
    <td>
    <img src="me.gif" name="pictures" width="99" height="100">
    </td>
    <td>
    <img src="me.gif" name="pictures1" width="99" height="100">
    </td>
    </tr>
    </table>
    </form>
     </body>
    </html>
    let me know if you need an explanation.


  •  

    Posting Permissions

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