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

Javascript
jquery ajax提交表单数据的两种方式
js数字输入框(包括最大值最小值限制和四舍五入)
文本框的字数限制功能jquery插件
JavaScript让IE浏览器event对象符合W3C DOM标准
为jquery.ui.dialog 增加“在当前鼠标位置打开”的功能
为jquery.ui.dialog 增加“自动记住关闭时的位置”的功能
js版扫雷实现代码 原理不错
鼠标跟随的文字变动效果
JS 判断undefined的实现代码
Ext grid 添加右击菜单
javascript或asp实现的判断身份证号码是否正确两种验证方法
javascript 获取元素位置的快速方法 getBoundingClientRect()
javascript 面向对象继承
JavaScript 地震特效
jquery.ui.progressbar 中文文档
JS 拖动效果实现代码 比较简单
JS小框架 fly javascript framework
JS在IE和FF下attachEvent,addEventListener学习笔记
js 对联广告、漂浮广告封装类(IE,FF,Opera,Safari,Chrome
js 动态选中下拉框

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


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