Fading Slide Show


/ Published in: JavaScript
Save to your folder(s)

Solo funciona para IE


Copy this code and paste it in your HTML
  1. <!-- THREE STEPS TO INSTALL FADING SLIDE SHOW:
  2.  
  3. 1. Copy the coding into the HEAD of your HTML document
  4. 2. Add the onLoad event handler into the BODY tag
  5. 3. Put the last coding into the BODY of your HTML document -->
  6.  
  7. <!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
  8.  
  9. <HEAD>
  10.  
  11. <SCRIPT LANGUAGE="JavaScript">
  12. <!-- Original: CodeLifter.com (support@codelifter.com) -->
  13. <!-- Web Site: http://www.codelifter.com -->
  14.  
  15. <!-- This script and many more are available free online at -->
  16. <!-- The JavaScript Source!! http://javascript.internet.com -->
  17.  
  18. <!-- Begin
  19. // Set slideShowSpeed (milliseconds)
  20. var slideShowSpeed = 5000;
  21. // Duration of crossfade (seconds)
  22. var crossFadeDuration = 3;
  23. // Specify the image files
  24. var Pic = new Array();
  25. // to add more images, just continue
  26. // the pattern, adding to the array below
  27.  
  28. Pic[0] = '1.jpg'
  29. Pic[1] = '2.jpg'
  30. Pic[2] = '3.jpg'
  31. Pic[3] = '4.jpg'
  32. Pic[4] = '5.jpg'
  33.  
  34. // do not edit anything below this line
  35. var t;
  36. var j = 0;
  37. var p = Pic.length;
  38. var preLoad = new Array();
  39. for (i = 0; i < p; i++) {
  40. preLoad[i] = new Image();
  41. preLoad[i].src = Pic[i];
  42. }
  43. function runSlideShow() {
  44. if (document.all) {
  45. document.images.SlideShow.style.filter="blendTrans(duration=2)";
  46. document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
  47. document.images.SlideShow.filters.blendTrans.Apply();
  48. }
  49. document.images.SlideShow.src = preLoad[j].src;
  50. if (document.all) {
  51. document.images.SlideShow.filters.blendTrans.Play();
  52. }
  53. j = j + 1;
  54. if (j > (p - 1)) j = 0;
  55. t = setTimeout('runSlideShow()', slideShowSpeed);
  56. }
  57. // End -->
  58. </script>
  59.  
  60. </HEAD>
  61.  
  62. <!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
  63.  
  64. <BODY onLoad="runSlideShow()">
  65.  
  66. <!-- STEP THREE: Copy this code into the BODY of your HTML document -->
  67.  
  68. <table border="0" cellpadding="0" cellspacing="0">
  69. <tr>
  70. <td id="VU" height=150 width=150>
  71. <img src="1.jpg" name='SlideShow' width=150 height=150>
  72. </td>
  73. </tr>
  74. </table>
  75.  
  76. <p><center>
  77. <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
  78. by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
  79. </center><p>
  80.  
  81. <!-- Script Size: 2.13 KB -->

URL: http://javascript.internet.com/miscellaneous/fading-slide-show.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.