This article describes the mobile phone streamlined slide effect implemented by JS. Share it for your reference, 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/"><img src=/"/templets/v1/images/fukeb.jpg/" id=/"showpic/" /></a></div>");Reproduction image:
For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript Traversal Algorithm and Skills", "Summary of JavaScript Switching Special Effects and Skills", "Summary of JavaScript Search Algorithm Skills", "Summary of JavaScript Animation Special Effects and Skills", "Summary of JavaScript Errors and Debugging Skills", "Summary of JavaScript Data Structures and Algorithm Skills" and "Summary of JavaScript Mathematical Operation Usage"
I hope this article will be helpful to everyone's JavaScript programming.