Because it is a novice, so when the photo album slide, just at the beginning of the situation will only be triggered to achieve the photo slide. Even with the setinterval () function, a similar function, such as Click (), must be added to trigger the left or right arrows for automatic sliding.
So how do you make a photo slide automatically without triggering any labels?
First look at the properties of the SetInterval () function: SetInterval (code,millisec[, "Lang"])
This definition of setinterval:
The SetInterval () method invokes a function or evaluates an expression according to the specified period (in milliseconds).
The SetInterval () method keeps calling functions until Clearinterval () is called or the window is closed. The ID value returned by SetInterval () can be used as a parameter to the Clearinterval () method.
Then, if you define a function, the function realizes the photo is displayed in turn, and then calls the function with SetInterval (), it should be possible to implement the automatic sliding of the photo without triggering.
Suppose a total of 4 photos, slide the class name of the Photo:
var I=1;
/* Define photo rotation function */
var slideauto=function () {
i++;
if (i==5) {i=1;};
$ (". Slide" +i). Show (). siblings (). Stop (). Hide ();
}
/* Call setinterval for no trigger slip */
var time=setinterval (slideauto,6000);
HTML Part code:
<div style= "position:relative;left:0;top:0;z-index:0;width:4000px;height:500px;" >
</div>
jquery implementation photo without trigger swipe