<! doctype>body{Width:430px; Margin:20px Auto; } P.now{Display:Block; Width:400px; Height:200px; Overflow:hidden; Border: 1px solid#CCC;} li.now{Color:#CCC;} li{List-style:none; float:Left ; Padding: 010px; Margin-bottom:5px; Border: 1px solid#CCC;Background#eee; } #fd{ List-style:none; float:Left ; Padding: 010px; Border: 1px solid#CCC;margin:0Auto; Background:#eee;} img{width:400px; Height:200px; Padding:1px; /*padding-top:18px;*/ } </style>class= "Now" ></p> <p style= "Display:none;" ></p> <p style= "Display:none;" ></p> <p style= "Display:none;" ></p> <ul> <liclass= "Now" >1</li> <li>2</li> <li>3</li> <li>4</li> </u L></div><script>vartags=$ ("FD"). getElementsByTagName ("Li");//Get toggle button Node varcats=$ ("FD"). getElementsByTagName ("P");//Get switch content node var Current;//variable-Xuan container with high-position current frame vartimer=2000;//set the 2-second loop once functionDisall () { for(vari=0; i<tags.length; i++) {Tags[i]. Classname= ""; Cats[i]. Classname= ""; Cats[i]. style.display= "None"; } } functionSetnow () { for(vari=0; i<tags.length; i++){ if(tags[i].classname== "Now"){ Current=i; } } } for(varj=0; j<tags.length; J + +) {Tags[j]. onmouseover=function() {clearinterval (h); Disall (); this. Classname= "Now"; Setnow (); cats[ Current].style.display= "Block"; cats[ Current].classname= "Now"; } Tags[j]. onmouseout=function() {setnow (); H=setinterval ("GoNext ()", 3000); } } functionGoNext () {setnow (); Current+=1; if( Current>=parseint (tags.length)) { Current=0; Disall (); cats[0].style.display= "Block"; tags[0].classname= "Now"; cats[0].classname= "Now"; }Else{disall (); cats[ Current].style.display= "Block"; cats[ Current].classname= "Now"; tags[ Current].classname= "Now"; } } varH=setinterval ("GoNext ()",timer); function$ (obj) {returnDocument.getElementById (obj); }</script></body>PHP AD Picture Looping slideshow effect