Introduction
I had been looking for the source of a web-based slide show for my own use. The features I wanted in my slide show pages were that it should dynamically select a picture in the server to display, it should display some transition effects, and it should not cause page refreshing. But I couldn’t find one of this kind. So I decided to code it myself.
There is a lot of source code to make the transition effect using JavaScript. But to address the dynamic selection of the picture to display and to avoid the page from refreshing, I used AJAX. There are a lot of AJAX frameworks and tools out there to choose from. But for this simple task, I just used the ASP.NET2’s built-in AJAX supported class System.Web.UI.ICallbackEventHandler
.
The included source code will demonstrate the use of this class, and also how to use JavaScript to make the request to get the next image file and apply the transition effects. One thing I need to mention is when applying transition effects, the next image has to be completely loaded before playing the effect, otherwise, the picture display will not be smooth and will be flickering. I also address this in my JavaScript code.
In fact, this is a part of my photo album web project. For the live demo of the slide show in my photo album, click here.
Using the code
To use the source, unzip the project files to a folder, load the Slideshow.sln in Visual Studio 2005, and run it.
Hope my post is useful to you. Enjoy!
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.