Multi-browser compatible QQ image rotation effect JavaScript code _ Image effects

Source: Internet
Author: User
<! 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> &LT;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> &LT;/TR&GT;&LT;/TBODY&GT;&LT;/TABLE&GT;&LT;/TD&GT;&LT;/TR&GT;&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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.