JavaScript pure JS Picture ad rotation effect [support IE7,IE8.FIREFOX,IE6]

Source: Internet
Author: User
Tags eval
Tip: You can modify some of the code before running

JavaScript pure JS Picture ad rotation effect [support IE7,IE8.FIREFOX,IE6] <! 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> Untitled document </title> </pead> <body> <SCRIPT> var widths=635; /* Display Height * * var heights=100; /* Display Width * * var counts=3; Img1=new Image (); img1.src= '/pic/123.gif '; Url1=new Image (); url1.src= ' http://111cn.net '; Img2=new Image (); img2.src= '/pic/dns.gif '; Url2=new Image (); url2.src= ' http://www.111cn.net '; Img3=new Image (); img3.src= '/pic/371.gif '; Url3=new Image (); url3.src= ' http://www.111cn.net '; /* Recommend that this block be placed in the following part of JS is almost no need for any changes * * var nn=1; var key=0; function change_img () {if (key==0) {key=1; }else if (document.alL) {document.getElementById (' pic '). Filters[0]. Apply (); document.getElementById (' pic '). Filters[0]. Play (duration=2); Eval (' document.getElementById (' pic '). Src=img ' +nn+ '. src '); Eval (' document.getElementById (' url '). Href=url ' +nn+ '. src '); for (Var i=1;i<=counts;i++) {document.getElementById (' XXJDJJ ' +i). Classname= ' Axx '; } document.getElementById (' XXJDJJ ' +nn). Classname= ' bxx '; nn++; if (nn>counts) {nn=1; } tt=settimeout (' Change_img () ', 8000); function changeimg (n) {nn=n; Window.clearinterval (TT); Change_img (); } document.write (' <style> '); document.write ('. axx{float:left; padding:0px 4px 1px;*padding:0px 4px 1px;border: #fff 1px solid; margin-right:5px; margin-bottom:5px;} '); document.write (' A.axx:link,a.axx:visited{text-decoration:none;color: #fff; line-height:12px;font:9px Verdana; Background-color: #aaa;} '); document.write (' A.axx:active,a.axx:hover{text-decoration:none;Color: #fff; line-height:12px;font:9px verdana;background-color: #ccc;} '); document.write ('. bxx{float:left; padding:0px 4px 1px;*padding:0px 4px 1px;border: #fff 1px solid;margin-right:5px; margin-bottom:5px;} '); document.write (' A.bxx:link,a.bxx:visited{text-decoration:none;color: #fff; line-height:12px;font:9px Verdana; Background-color: #f90;} '); document.write (' A.bxx:active,a.bxx:hover{text-decoration:none;color: #fff; line-height:12px;font:9px Verdana; Background-color: #f90;} '); document.write (' </style> '); document.write (' <div +widths+ ' px;height: ' +heights+ ' px;overflow:hidden;text-overflow:clip;position:relative; " > '); document.write (' <div></div> '); document.write (' <div > '); for (Var i=1;i<counts+1;i++) {document.write (' +i+ '); } document.write (' </div></div> '); Change_img (); </SCRIPT> </body> </ptml>
Tip: You can modify some of the code before running
Related Article

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.