<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <meta http-equiv=" Content-type "content=" text/html; charset=gb2312 "/> <title>js picture Rotation Effect Code _ Cloud Habitat Community </title> </pead> <body> <table class=bdc6 Heig ht=359 cellspacing=0 cellpadding=0 width= "100%" border=0> <TBODY> <TR> <TD valign=top> <table height=6 cellspacing=0 cellpadding=0 "width=" 100% <TBODY> <TR> <TD></TD></TR></TBODY></TABLE> <table height=170 cellspacing=0 cellpadding=0 width=150 align=center <TBODY> <TR> <td valign=top height=170> <div ID =bimg > <div Class=undis ></DIV> <div Class=dis ></DIV> <div Class=dis ></DIV> </DIV></TD></TR></TBODY></TABLE> <table height=24 cellspacing=0 cellpadding=0 width=150 Align=center & Lt tbody> <TR> <td class=f14 id=info width=227> CLA ss=dis>22 ton excavator </DIV> <div class=dis> nineth, live </DIV> <div class= dis> expression </DIV> </TD> <td width=59> <table id=simg cellspacing =0 cellpadding=2 width= "100%" Align=right border=0> <TBODY> <tr align=middle> <td class=s>1</td> <td>2& Lt;/td> <TD>3</TD> </TR></TBODY></TABLE></TD></TR>&L T;/tbody></table></td></tr></tbody></table> <SCRIPT> function $ (v) {return D Ocument.getelementbyid (v)} var img = $ ("bimg"). getElementsByTagName ("div"); var td = $ ("simg"). getElementsByTagName ("TD"); var text = $ ("info"). getElementsByTagName ("div"); var now = 1; var count = 3; Set quantity var def = 0; Default display var speed = 1000; 10 sec//initialize for (var i=0;i<count;i++) {//td td[i].name = i; Td[i].classname = ""; Td[i].onclick = function () {Changebar (this.name)} td[i].onmouseover = function () {Clearauto ()} td[i].onmouseout = function () {Setauto ()}//img img[i].style.display = "None"; Img[i].onmouseover = function () {Clearauto ()} img[i].onmouseout = function () {Setauto ()}//text text[i ].style.display = "None"; text[i].oNmouseover = function () {Clearauto ()} text[i].onmouseout = function () {Setauto ()}}//set default Td[def].classname = "S"; Img[def].style.display = "block"; Text[def].style.display = "block"; function SetClass (v) {for (var i=0;i<count;i++) td[i].classname = ""; Td[v].classname = "S"; function Setimg (v) {try{with (bimg) {filters[0]. Apply (); for (Var i=0;i<count;i++) {Img[i].style.display = ' none '; Text[i].style.display = "None"; } img[v].style.display = "block"; Text[v].style.display = "block"; Filters[0].play (); catch (E) {for (Var i=0;i<count;i++) {Img[i].style.display = ' none '; Text[i].style.display = "None"; } img[v].style.display = "block"; Text[v].style.display = "block"; } } //contorl changed function Changebar (v) {SetClass (v); Setimg (v); Now= v+1; //set auto var auto = '; function Setchange () {if (Now<count) {Changebar (now); } else{now = 0; Changebar (now); The function Setauto () {auto = SetInterval ("Setchange ()", Speed)} function Clearauto () {clearinterval (Auto)} setauto (); </SCRIPT> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]