This article describes the JS implementation of the mobile phone-side thin slide effect. Share to everyone for your reference, specific as follows:
var curindex = 0;
var timeinterval = 4000;
var arr = new Array ();
Arr[0] = "fukeb.jpg";
ARR[1] = "baopi.jpg";
ARR[2] = "renliub.jpg";
SetInterval (changeimg, timeinterval);
function changeimg () {
var obj = document.getElementById ("Showpic");
if (Curindex = = arr.length-1) {
curindex = 0;
} else {
curindex = 1;
}
OBJ.SRC = "/templets/v1/images/" + Arr[curindex];
}
Document.writeln ("<div style=\" width:300px;margin:10px auto 0 auto;overflow:hidden;\ "><a href=\"/zixun/?f= Top_ad\ "target=\" _blank\ "></a></div" > ");
Effect Chart:
More readers interested in JavaScript-related content can view the site topics: "JavaScript traversal algorithm and tips summary", "JavaScript switching effects and techniques summary", "JavaScript Search Algorithm Skills summary", " JavaScript animation effects and tips Summary, "JavaScript Error and debugging skills Summary", "JavaScript data structure and algorithm skills summary" and "JavaScript Mathematical Computing Usage Summary"
I hope this article will help you with JavaScript programming.