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

Javascript
js操作ajax返回的json的注意问题!
javascript document.compatMode兼容性
jquery 锁定弹出层实现代码
Jquery+CSS 创建流动导航菜单 Fluid Navigation
js下用层来实现select的title提示属性
JSON 学习之JSON in JavaScript详细使用说明
jquery实现的超出屏幕时把固定层变为定位层的代码
jQuery 性能优化手册 推荐
javascript Firefox与IE 替换节点的方法
ext combox 下拉框不出现自动提示,自动选中的解决方法
json-lib出现There is a cycle in the hierarchy解决办法
判断控件是否已加载完成的代码
javascript for循环设法提高性能
js 表格拖拽效果实例代码 (IE only)
javascript 命名规则 变量命名规则
js 面向对象的技术创建高级 Web 应用程序
User agent字符串将成为用户真正的隐私问题
JS教程:JavaScript全半角转换
JS教程:Chrome对数组的sort方法优化
WEBJX收集非常有用的免费的Javascript开发工具

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


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