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

Javascript
javascript form 验证函数 弹出对话框形式
IE JS编程需注意的内存释放问题
JQuery 无废话系列教程(二) jquery实战篇上
一些常用的JS功能函数代码
一个很酷的拖动层的js类,兼容IE及Firefox
JavaScript 开发中规范性的一点感想
javascript 连连看代码出炉
javascript 读取图片文件的大小
JQuery 国际象棋棋盘 实现代码
javascript 可以拖动的DIV(二)
[原创]javascript 改变字体大小方法集合
javascript 变量作用域 代码分析
js AspxButton的客户端操作
event对象的方法 兼容多浏览器
Javascript 阻止javascript事件冒泡,获取控件ID值
Javascript 函数对象的多重身份
javawscript 三级菜单的实现原理
js 跨域和ajax 跨域问题小结
JavaScript XML操作 封装类
通用的二级菜单代码(css+javascript)

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-10   浏览: 406 ::
收藏到网摘: 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>