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

  1. <ccResource>
  2.   <ccTitle>
  3. Image Slideshow
  4.   </ccTitle>
  5.   <ccCategory>
  6. Images
  7.   </ccCategory>
  8.   <ccDescription>
  9. Display your images on your site in a new window in a slideshow fasion.
  10.   </ccDescription>
  11.   <ccInstructions>
  12.  
  13.   </ccInstructions>
  14.   <ccHeadContent>
  15.   <SCRIPT LANGUAGE="JavaScript">
  16. <!-- Begin
  17. var n = 0;
  18.  
  19. timedelay = 3;  // 3 secs between pics
  20. timedelay *= 1000;
  21.  
  22. windowprops = "top=250,left=15,width=200,height=200"; // customize the popup window here
  23.  
  24. var imgs = new Array();
  25. imgs[0] = "http://www.your-site.com/images/image1.gif";
  26. imgs[1] = "http://www.your-site.com/images/image2.gif";
  27. imgs[2] = "http://www.your-site.com/images/image3.gif";
  28. imgs[3] = "http://www.your-site.com/images/image4.gif";
  29.  
  30. var page = new Array();
  31. page[0] = "http://www.your-site.com/page1.html";
  32. page[1] = "http://www.your-site.com/page2.html";
  33. page[2] = "http://www.your-site.com/page3.html";
  34. page[3] = "http://www.your-site.com/page4.html";
  35.  
  36. function hook() {
  37. var p = (n == 0) ? page[page.length-1] : page[n-1];
  38.  
  39. window.open(p,"",windowprops);
  40.  
  41. // or, instead of opening a new window, 
  42. // send them to the new page instead with:
  43. // document.location.href = p;
  44.  
  45. }
  46.  
  47. function rotate() {
  48. document.picform.slideshow.src = imgs[n];
  49. (n == (imgs.length - 1)) ? n = 0 : n++;
  50. window.setTimeout("rotate()", timedelay);
  51. }
  52. window.onload = rotate;
  53. //  End -->
  54. </script>
  55.   </ccHeadContent>
  56.   <ccBodyContent>
  57. <center>
  58. <form name=picform>
  59. <a href="javascript:hook();"><img name=slideshow src="pic.gif"></a>
  60. </form>
  61. </center>
  62.  
  63.   </ccBodyContent>
  64.   <ccElementContent>
  65.   
  66.    <ccElementName></ccElementName>
  67.    <ccElementAction></ccElementAction>
  68.    
  69.   </ccElementContent>
  70.   <ccExtraData>
  71.  
  72.   </ccExtraData>
  73. </ccResource>