当前位置: 首页 > 图文教程 > 网络编程 > Javascript > Vml+Dhtml:制作一个应用渐变颜色效果不错的进度条

Javascript
11款基于Javascript的文件管理器
5款Javascript颜色选择器
JavaScript 对话框和状态栏使用说明
状态栏 时间显示效果 数字钟
在图片上单击获取图片原始大小
禁止在图片上使用右键
javascript 操作Word和Excel的实现代码
几个javascript操作word的参考代码
innerhtml用法 innertext用法 以及innerHTML与innertext的区别
解决表单中第一个非隐藏的元素获得焦点的一个方案
解决jquery .ajax 在IE下卡死问题的解决方法
javascript 实现划词标记划词搜索功能
用Greasemonkey 脚本收藏网站会员信息到本地
javascript 关于# 和 void的区别分析
DIV+CSS+JS 变灰弹出层
Ajax+Json 级联菜单实现代码
javascript 读取XML数据,在页面中展现、编辑、保存的实现
html 锁定页面(js遮罩层弹出div效果)
基于jQuery的日期选择控件
javascript获得CheckBoxList选中的数量

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-10   浏览: 174 ::
收藏到网摘: n/a

<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>