zhulei1978 发表于 2007-6-26 10:19

[转载]Vml+Dhtml:制作一个应用渐变效果不错的进度条

<DIV class=htmlcode>&lt;HTML xmlns:v&gt;<BR>&lt;HEAD&gt;<BR>&lt;META http-equiv='Content-Type' content='text/html;charset=gb2312'&gt;<BR>&lt;Meta name='Gemeratpr' content='网络程序员伴侣(Lshdic)2004'&gt;<BR>&lt;TITLE&gt;效果不错的VML进度条&lt;/TITLE&gt;<BR>&lt;STYLE&gt;<BR>v\:*{behavior:url(#default#VML);}<BR>*{font-size:12px;color:;}<BR>&lt;/STYLE&gt;<BR>&lt;/HEAD&gt;<BR>&lt;BODY topmargin='2' leftmargin='2'&gt;<BR>&lt;div style='table-Layout:fixed;width:100%;height:100%;border:1 solid black'&gt;<BR>&lt;v:RoundRect id='a' style='position:absolute;left:300;top:250;height:29;'&gt;<BR>&lt;v:Textbox inset='5px,5px,5px'&gt;&lt;b&gt;&lt;font color='red' id='jindu'&gt;&lt;/font&gt;&lt;/b&gt;&lt;/v:textbox&gt;<BR>&lt;v:fill type='gradient' id='fill1' color='blue'/&gt;<BR>&lt;/v:RoundRect&gt;<BR>&lt;/div&gt;<BR>&lt;script&gt;<BR>//原作:风云舞,载自:http://www.lshdic.com/bbs<BR>var pos1=1,posall=200  //定义全局变量,pos1为当前进度,posall为总进度<BR>function play1(){ //播放函数<BR>if(pos1&lt;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>&lt;/script&gt;<BR>&lt;/BODY&gt;<BR>&lt;/HTML&gt; </DIV>

cyyu_ryh 发表于 2007-6-26 12:27

效果还不错就是太快了

zhulei1978 发表于 2007-6-26 14:36

呵呵

lmhllr 发表于 2007-6-26 20:00

很棒啊...

zhulei1978 发表于 2007-6-26 21:00

<P>呵呵</P>

页: [1]

编程论坛