Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 9th, 2012  |  syntax: None  |  size: 1.24 KB  |  views: 112  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <html>
  2. <head>
  3. <title> Image Drop Down Select </title>
  4. <style type="text/css">
  5. .SBox {
  6.   display:none;
  7. }
  8.  
  9. </style>
  10. <script type="text/javascript">
  11. // For: http://www.codingforums.com/showthread.php?t=211072
  12.  
  13. function changeImg(info) {
  14.   if (info == '') { return; }
  15.   document.getElementById('mainImage').src = info;
  16.   document.getElementById('SBox').style.display = 'none';
  17. }
  18. </script>
  19. </head>
  20. <body>
  21. <div id="imgContent">
  22.  <img id="mainImage" src="http://www.nova.edu/hpd/otm/pics/4fun/11.jpg"
  23.   onclick="document.getElementById('SBox').style.display='block'"><br>
  24.  <select id="SBox" onChange="changeImg(this.value)" style="display:none;font-size:12px;border: 1px solid #3366cc;
  25.   color: #000033;
  26.   background-color: #6699FF;border-radius: 10px;
  27.   font-color:#FFF;
  28.    width:100px;">
  29.   <option value=''>Choose</option>
  30.   <option value='http://www.nova.edu/hpd/otm/pics/4fun/11.jpg'>11</option>
  31.   <option value='http://www.nova.edu/hpd/otm/pics/4fun/12.jpg'>12</option>
  32.   <option value='http://www.nova.edu/hpd/otm/pics/4fun/13.jpg'>13</option>
  33.   <option value='http://www.nova.edu/hpd/otm/pics/4fun/14.jpg'>14</option>
  34.   <option value='http://www.nova.edu/hpd/otm/pics/4fun/15.jpg'>15</option>
  35.  </select>
  36. </div>
  37. </body>
  38. </html>