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

lshdic 2003-08-21 02:40:49
<HTML xmlns:v>
<HEAD>
<META http-equiv='Content-Type' content='text/html;charset=gb2312'>
<Meta name='Gemeratpr' content='网络程序员伴侣(Lshdic)2004'>
<TITLE>效果不错的VML进度条</TITLE>
<STYLE>
v\:*{behavior:url(#default#VML);}
*{font-size:12px;color:;}
</STYLE>
</HEAD>
<BODY topmargin='2' leftmargin='2'>
<div style='table-Layout:fixed;width:100%;height:100%;border:1 solid black'>
<v:RoundRect id='a' style='position:absolute;left:300;top:250;height:29;'>
<v:Textbox inset='5px,5px,5px'><b><font color='red' id='jindu'></font></b></v:textbox>
<v:fill type='gradient' id='fill1' color='blue'/>
</v:RoundRect>
</div>
<script>
//原作:风云舞,载自:http://www.lshdic.com/bbs
var pos1=1,posall=200 //定义全局变量,pos1为当前进度,posall为总进度
function play1(){ //播放函数
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)+")"}
a.style.width=Math.round(300/(posall/pos1));jindu.innerText=pos1+"/"+posall+","+Math.round(100/(posall/pos1))+"%"
fill1.angle=Math.round(300/(posall/pos1))
}
setInterval("play1()",10) //10毫秒播放一次,一般CPU保证能消化~~~
</script>
</BODY>
</HTML>
...全文
30 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
jackie615 2003-08-21
  • 打赏
  • 举报
回复
不错的DD
nik_Amis 2003-08-21
  • 打赏
  • 举报
回复
good
wjcking 2003-08-21
  • 打赏
  • 举报
回复
收藏
smallbear0425 2003-08-21
  • 打赏
  • 举报
回复
thanks very much!!!
please go on!!!

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧