[转载]Vml+Dhtml:制作一个应用渐变效果不错的进度条
<DIV class=htmlcode><HTML xmlns:v><BR><HEAD><BR><META http-equiv='Content-Type' content='text/html;charset=gb2312'><BR><Meta name='Gemeratpr' content='网络程序员伴侣(Lshdic)2004'><BR><TITLE>效果不错的VML进度条</TITLE><BR><STYLE><BR>v\:*{behavior:url(#default#VML);}<BR>*{font-size:12px;color:;}<BR></STYLE><BR></HEAD><BR><BODY topmargin='2' leftmargin='2'><BR><div style='table-Layout:fixed;width:100%;height:100%;border:1 solid black'><BR><v:RoundRect id='a' style='position:absolute;left:300;top:250;height:29;'><BR><v:Textbox inset='5px,5px,5px'><b><font color='red' id='jindu'></font></b></v:textbox><BR><v:fill type='gradient' id='fill1' color='blue'/><BR></v:RoundRect><BR></div><BR><script><BR>//原作:风云舞,载自:http://www.lshdic.com/bbs<BR>var pos1=1,posall=200 //定义全局变量,pos1为当前进度,posall为总进度<BR>function play1(){ //播放函数<BR>if(pos1<posall)pos1+=1;else{pos1=1;fill1.color="rgb("+Math.round(Math.random()*255)+","+Math.round(Math.random()*255)+","+Math.round(Math.random()*255)+")"}<BR>a.style.width=Math.round(300/(posall/pos1));jindu.innerText=pos1+"/"+posall+","+Math.round(100/(posall/pos1))+"%"<BR>fill1.angle=Math.round(300/(posall/pos1))<BR>}<BR>setInterval("play1()",10) //10毫秒播放一次,一般CPU保证能消化~~~<BR></script><BR></BODY><BR></HTML> </DIV>页:
[1]
