Sinister Labs
Web Development/Microsoft Custom Programing
Home  ::   About Us  ::   Software  ::   Freeware  
PHP/JavaScript Slideshow

The purpose of this code is to easily display a large number of images by rotating through them, one at a time. The script must be installed into a .php page, or your server must be set up to process PHP code within the file extension you wish to use. The PHP script outputs a combination of HTML and JavaScript and provides easy access to several vaiables that can be used to change the presentation of the slideshow. Options allow you to change:

  • a title for the overall set of slideshows,
  • the size the images are displayed (images retain their original aspect ratio),
  • whether or not to show the slideshow selector list,
  • whether or not to show the random checkbox,
  • whether or not to show a control that changes the speed of the show,
  • the color of the background behind the show, and
  • the size of the border around the slideshow.
  • the position of the controls (above or below the slideshows).

Copy your .JPG, .JPEG or .GIF images into one or more directories on your web server. Think of each directory of images as a slideshow. Copy the code into your web page, then set up the code to include the directories you've created and set up the various options. If you have set up the options to display the controls, viewers of your page may select which slideshow to watch, whether the image files are presented sequentially or randomly and the delay time between picture.

Here's an example of this code in action



So, did we really need to get fancy and use two different programming languages for this? Yes, we did and the reason is pretty straigtforward. JavaScript is just what we need to update the pictures every few seconds, creating the 'sllideshow' effect. However, JavaScript can't do things like 'list' the files within directories or get at each image's height and width After building many slideshows in the past where I typed in the name of every single file I'm using, I decided that it was time to start using PHP to do these kinds of tasks. In the process, we have a tool that's easy and flexible to use.

Home About Us Software Freeware