Home
Developer Blog
Ajax effects
CSS examples
Freelance jobs
Hot IT Jobs
Hot scripts
Code samples
Web hosting directory
Lotus Notes FAQ
See the new scripts recently added to Dynamic Drive.
Click here
.
Original, practical
CSS codes and examples
such as CSS menus for your site.
Search code samples
Keyword
All Categories
ASP
CSS
Dhtml
Html
Javascript
PHP
Code Samples
ASP
CSS
Dhtml
Html
Javascript
PHP
LOGIN HERE
Username
Password
Signup Now
Forgot Password
Verify Signup
Javascript >> Images
How can I script an image slide show?
Visitor Ratings (0) :
Description
This script allows you to display a "Slide Show".
Code
Select All
<html> <script> // Set slideShowSpeed (milliseconds) var slideShowSpeed = 5000 // Duration of crossfade (seconds) var crossFadeDuration = 3 // Specify the image files var Pic = new Array() Pic[0] = 'gallery/Fgallery912.jpg' Pic[1] = 'gallery/Fgallery913.jpg' Pic[2] = 'gallery/Fgallery914.jpg' Pic[3] = 'gallery/Fgallery915.jpg' Pic[4] = 'gallery/Fgallery916.jpg' var t var cnt = 0 var p = Pic.length var imag1 = new Array() for (i = 0; i < p; i++){ imag1[i] = new Image() imag1[i].src = Pic[i] } function rotate(){ if (document.all){ document.images.SlideShow.style.filter="blendTrans(duration=2)" document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)" document.images.SlideShow.filters.blendTrans.Apply() } h = imag1[cnt].height; if (h>800){ var height1 = parseInt( imag1[cnt].height * 500 / imag1[cnt].width) ; } else{ var height1 = h ; } document.images.SlideShow.height = height1; document.images.SlideShow.src = imag1[cnt].src if (document.all){ document.images.SlideShow.filters.blendTrans.Play() } cnt = cnt + 1 if (cnt > (p-1)) cnt=0 t = setTimeout('rotate()', slideShowSpeed) } </script> <body onload="rotate()"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td id="VU" height=150 width=150> <img src="1.jpg" name='SlideShow' ></td> </tr> </table></body></html>
Rate this Resource
0
1
2
3
4
5
6
7
8
9
10