home *** CD-ROM | disk | FTP | other *** search
/ PC User 2005 May / CD / PCU0505CD.iso / software / full / coffecup / files / html2005.exe / %MAINDIR% / Javascript / ImagePreviewer.xml < prev    next >
Encoding:
Text File  |  2005-02-16  |  1.3 KB  |  60 lines

  1. <ccResource>
  2.   <ccTitle>
  3. Image Previewer
  4.   </ccTitle>
  5.   <ccCategory>
  6. Images
  7.   </ccCategory>
  8.   <ccDescription>
  9.  
  10.   </ccDescription>
  11.   <ccInstructions>
  12.  
  13.   </ccInstructions>
  14.   <ccHeadContent>
  15. <SCRIPT LANGUAGE="JavaScript">
  16. function CoffeePreview(sel) {
  17. document.CoffeePreview.src = "" + sel.options[sel.selectedIndex].value;
  18. }
  19. function CoffeeShow(sel) {
  20. images = new Array();
  21. images[1] = "1.jpg";
  22. images[2] = "2.jpg";
  23. images[3] = "3.jpg";
  24. images[4] = "4.jpg";
  25. images[5] = "5.jpg";
  26. images[6] = "6.jpg";
  27. window.location.href = images[sel.selectedIndex+1];
  28. }
  29. //  End -->
  30. </script>
  31.   </ccHeadContent>
  32.   <ccBodyContent>
  33. <center>
  34. <form name=previewselect>
  35. <select name=selbox size=1 onChange="CoffeePreview(this)">
  36. <option value="1-small.jpg">Image #1
  37. <option value="2-small.jpg">Image #2
  38. <option value="3-small.jpg">Image #3
  39. <option value="4-small.jpg">Image #4
  40. <option value="5-small.jpg">Image #5
  41. <option value="6-small.jpg">Image #6
  42. </select>
  43. <p>
  44. <img name="preview" src="1-small.jpg" width=150 height=113 border=1>
  45. <p>
  46. <input type=button value="view Image" onclick="CoffeeShow(this.form.selbox)">
  47. </form>
  48. </center>
  49.  
  50.   </ccBodyContent>
  51.   <ccElementContent>
  52.   
  53.    <ccElementName></ccElementName>
  54.    <ccElementAction></ccElementAction>
  55.    
  56.   </ccElementContent>
  57.   <ccExtraData>
  58.  
  59.   </ccExtraData>
  60. </ccResource>