Make a Slide Show and tell your story! Learn how easy it is to make a dynamic slide show with simple sample code. It is fast and easy! To create a very basic image slideshow is very simple. You can use your own pictures, photos and bellow javascript slideshow code as a sample to create image slideshow for websites easily.
Things you will need to do before hand:
1. Create a html document “sample.html”, a directory “images” under the same folder;
2. Copy or move your image files to the “images” directory.
Two steps to create basic photo slideshow
1. Copy the sample slideshow code into the HEAD of your HTML document “sample.html”
—code section 1-javascript slideshow code—
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
NewImg = new Array (
"images/01.jpg",
"images/02.jpg",
"images/03.jpg"
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;
//Time delay between Slides in milliseconds
var delay = 3000;
var lock = false;
var run;
function chgImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slideshow.src = NewImg[ImgNum];
}
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
}
}
// End -->
</script>
—End of javascript slideshow code -section 1—
2. Add the last sample slideshow code into the BODY of your HTML document
—Code section 2-javascript slideshow code—-
<img src="images/01.jpg" name="slideshow"> <table> <tr> <td align="right"><a href="javascript:chgImg(-1)">Previous</a></td> <td align="center"><a href="javascript:auto()">Auto/Stop</a></td> <td align="left"><a href="javascript:chgImg(1)">Next</a></td> </tr> </table>
—End of javascript slideshow code- section 2—
Save the HTML page, you are done. View it in browser as bellow:
Now you know how easy it is to make a dynamic slide show with sample javascript slideshow code. No complex coding, no flash knowledge, no flash tools, just your pictures and photos. Now try to create a slide show and tell your story. It is easy and Fun.
Related posts:
- How to Create a Photo Slideshow With Dreamweaver The easiest way to create simple photo slideshow. How to Create a Photo Slideshow With Dreamweaver? How to create professional flash photo gallery? How to create professional flash photo gallery without flash knowledge? What is the best Flash slideshow, flash...
- How to Edit and Create new Photo Slideshow With Dreamweaver How to use Macromedia Dreamweaver 8 and Adobe Dreamweaver CS3 to edit Flash SWF or create new photo slideshows?...
- Add Flash Animation to Yahoo Sitebuilder Site Steps to make flash photo slideshow for yahoo sitebuilder and embed Flash Animation to Yahoo Sitebuilder Site....
- How to make Halloween scary How to create a cool Halloween scene slideshow with music. Create a cool slideshow with Halloween scenes may be really a good way to spend the good time with your family....
- WordPress Says NO to Flash Do you have Trouble embedding flash in wordpress.com blogs? It seems that Wordpress.com did everything to prevent flash. Wordpress.com filters out any flash embed and object tags or other 'unwanted' code....


















Thanks for the source, I will use it.
Your welcome!
Thanks for stopping by.
Hi! Where do I keep the image files?
Hi,
Can you please try to refresh the slideshow example code post again?
There are 2 screen shots above, the first image shows where to put the photo slides.
My blog had a glitch that prevented the images from showing up. Sorry for that.
Thanks.
Thank you finally i found a code that work and i understood
Thanks for this great publication
@bob, try to check the names of your images, should be 01,02,03.jpg. Otherwise, u hard-code the names in sample.html
[...] tools to make photo slideshows. For instance, you can make a photo slideshow using javascript, see Simple Code to Create Photo Slideshows, you can also use Adobe Dreamweaver or Flash to make photo [...]
Hi Bob.
I have just tried this tutorial on a test page / site and it works really well.! Thank you so much for posting it on your blog.
I would love to be able to make a few minor changes to the slideshow and wondered if you would be willing to please tell me how I’m able to make those changes…
1. Ideally I would like to change the text colour in the table (Prev / Auto / Stop / Next). Can a CSS control this? If not, then what is the best way?
2. I would like the slideshow to start playing automatically as soon as the slideshow page is loaded? Is there any way of doing this?
I hope you are not too busy to be able to consider a reply.
Many thanks.
Hi Kevin,
thanks for stopping by.
1. to chnage the text colour in the table, you can just use the tag span along with style,
you can download this one from http://www.szcchina.com/blog/uploads/new-slideshow.zip
(it is password protected, the password is your email address on …ff@mac.com).
just make sure to change the HTML color code to your needs.
FYI, you can find out these code online from http://html-color-codes.info/
2. For fancy play control, you may consider Flash.
You can download this sample from http://www.szcchina.com/blog/uploads/flash.zip (it is password protected, the password is your email address on …ff@mac.com). To replace your own images, or add new images, You can customize the XML file with a text editor.