<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Untitled Document</title><styletype= "Text/css">*{margin:0px;padding:0px;font-family:"Microsoft Jas Black";}#tuijian{width:940px;Height:500px;background-repeat:no-repeat;margin:Auto; }. Pages{Line-height:500px;Background-color:#000;background-position:Center;background-repeat:no-repeat;Opacity:0.4;width:30px;Height:60px; }#p1{Background-image:URL (zuo.jpg);float: Left;margin:180px 0px 0px 10px;}#p2{Background-image:URL (you.jpg);float: Right;margin:180px 10px 0px 0px;} </style></Head><Body><DivID= "Tuijian"style= "Background-image:url (e8z311o60r7w.jpg)"><Divclass= "pages"ID= "P1"onclick= "Dodo ( -1)"></Div><Divclass= "pages"ID= "P2"onclick= "Dodo (1)"></Div></Div></Body></HTML><Scripttype= "Text/javascript">varjpg=NewArray (); jpg[0]="URL (1212.jpg)"; jpg[1]="URL (1213.jpg)"; jpg[2]="URL (1214.jpg)";vartjimg=document.getElementById ("Tuijian");varXB=0;varN=0;functionHuan () {XB++; if(XB==jpg.length) {XB=0; } tjimg.style.backgroundImage=JPG[XB]; if(n==0) { varID=Window.settimeout ("Huan ()", the); } }functionDodo (m) {n=1; XB=XB+m; if(XB<0) {XB=Jpg.length-1;} Else if(XB>=jpg.length) {XB=0; } tjimg.style.backgroundImage=JPG[XB];} Window.settimeout ("Huan ()", the);</Script>
View Code
Automatic and manual switching of pictures