You may have seen the effect of the slide picture. Here is a good example. If you are interested, refer to section 1 and add the following elements on the page. Displays the output and output image file list.
The Code is as follows:
Image name
2. Playback file list method. The main function is to traverse the file list and display the image in the corresponding image container to show the effect of the slide.
You can use the latency method to call the Traversal method: window. setInterval ("PlayPics ()", speed );
The Code is as follows:
/**
* Method of processing the playback Image
**/
Function PlayPics ()
{
Var sel = document. getElementById ("img_date ");
If (sel. length = 0) // return directly if no image is available
{
Return;
}
Else
{
If (sel. selectedIndex> 0) // when the subscript of the selected image is greater than 0, the item is selected.
{
Sel. options [sel. selectedIndex-1]. selected = true;
}
Else {// If the subscript of the selected item is 0, set the last image to be selected.
Sel. options [sel. length-1]. selected = true;
}
ChangePic (sel. options [sel. selectedIndex]. value); // obtain the selected image and set the image url to the corresponding image container.
// This method can be modified as needed.
}
};