When making web pages, you need to use JS to display images with special effects. The following is a simple image switching using JS. Copy code The code is as follows: < head> <br><br>var srr = new Array('Picture 1', 'Picture 2', 'Picture 3', 'Picture 4') ;//Use the built-in array in JS to store data <br>var s = 0; <br>function chage() { <br>var img = document.getElementById('img1'); <br>if ( s <srr.length-1 ) { <BR>s ; <BR>} <BR>else { <BR>s = 0; <BR>} <BR>img.setAttribute('src', srr[s] ); <BR>} <BR>function diaoyong() { <BR>setInterval(chage, 1000); <BR>} <br><br>