<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" > <ptml> &L t;head> <meta http-equiv= "Content-type" content= "text/html"; charset=gb2312 "> <title> Untitled document </title> <style> #pshow {margin:auto;width:180px;height:137px; Filter:progid:DXImageTransform.Microsoft.Alpha (opacity=100);} </style> <script language= "javascript" type= "Text/javascript" >/*imagechange start*/var changetime=2000, gradechangetime=100,changespeed=10,imagecounter=4,nowimage,startopacity; var imagelink=new Array () var Filterobj,imageobj,changecontrol; function Changeinit () {Filterobj=document.getelementbyid ("pshow"); Imageobj=filterobj.childnodes[0]; if (document.all) startopacity=filterobj.filters[0]. Opacity; for (i=0;i<imagecounter;i++) imagelink[i]= "Http://bbs.blueidea.com/images/blue/smilies/icon" + (i+8) + ". gif"; Nowimage=math.floor (Math.random () *4); Imageobj.src=imagelinK[nowimage]; Changecontrol=setinterval ("changeimg ();", changetime); The function changeimg () {if (document.all) {clearinterval (Changecontrol); Gradedescopt (); } Else{imageobj.src=imagelink[nowimage];} Nowimage==3? nowimage=0:nowimage++; The function gradeaddopt () {if (startopacity<100) {startopacity+=changespeed; Startopacity>100? startopacity=100:{}; Filterobj.filters[0]. opacity=startopacity; SetTimeout ("gradeaddopt ();", gradechangetime); } else{changecontrol=setinterval ("changeimg ();", changetime); The function gradedescopt () {if (startopacity>0) {startopacity-=changespeed; Startopacity<0? startopacity=0:{}; Filterobj.filters[0]. opacity=startopacity; SetTimeout ("gradedescopt ();", gradechangetime); } else {imageobj.src=imagelink[nowimage]; Gradeaddopt (); Return }/*imagechange End-------------------------------------------------------------/* </script> </pead> <body onload= "Changeinit ();" > <div id= "pshow" ></div> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Oh, do the website when wrote a simulation filter picture fade effect, if the original has such a post, please help me to see the following questions, thank you!
Although it can be run, but put on my site on the rotation of the picture when the CPU occupancy rate increased by about 15%, but the individual browsing will not, do not know how the matter, please enlighten.