1, add the following element to the page. Displays a list file of the set picture files.
Copy Code code as follows:
<select id= "Img_date" style= "width:100%; margin-top:10px; height:50% "Size=" >
<option value= "The URL of the picture" > Picture name </option>
</select>
2, the way to play the list of files. The main is to traverse the file list and show the picture in the corresponding picture container can show the effect of the slide.
The traversal method can be invoked using a delay method: Window.setinterval ("Playpics ()", speed);
Copy Code code as follows:
/**
* How to play the picture processing
* */
Function playpics ()
{
var s el = document.getElementById ("Img_date");
if (sel.length==0)//If no picture is returned directly
{
return;
}
Else
{
if (sel.selectedindex>0)//The selected subscript is greater than 0 o'clock to set the previous picture item to be selected.
{
Sel.options[sel.selectedindex-1].selected=true;
}
else{//if the subscript for the selected item is 0, set the last picture to be selected.
Sel.options[sel.length-1].selected=true;
}
Changepic (sel.options[sel.selectedindex].value);//Get the selected picture and set the URL of the picture to the appropriate picture container. The
//method can be modified to suit your needs.
}
};