简单的进度条
2016-02-24 13:30
309 查看
<div class="progressBar"> <div id="bar"></div> </div> css样式 .progressBar{ width: 200px; height: 8px; border: 1px solid #98AFB7; border-radius: 5px; margin-top: 10px; } #bar{ width: 0px; height: 8px; border-radius: 5px; background: #5EC4EA; } js代码 progressBar() function progressBar (){ //初始化js进度条 $("#bar").css("width","0px"); //进度条的速度,越小越快 var speed = 20; bar = setInterval(function(){ nowWidth = parseInt($("#bar").width()); if(nowWidth <= 200){ barWidth = (nowWidth + 1)+"px"; $("#bar").css("width" , barWidth); }else{ //进度条读满之后,停止 clearInterval(bar); } },speed) }
相关文章推荐
- 怎么解决input框中加入disabled="disabled"之后,改变字体的颜色(默认的是灰色)
- 关于Method override for the designated initializer of the superclass '-init' not found警告
- git修改了本地代码想传到新的branch
- chrome浏览器快捷键大全
- 静态工厂方法
- 浅谈 Linux 系统中的 SNMP Trap
- mysql自动断开连接的问题处理
- Ajax 不仅仅 是一种时尚,它是一种构建网站的强大方法
- 《Java并发编程实战》第六章 任务运行 读书笔记
- 小结
- 腾讯研发工程师笔试题(整理)
- typecho篇
- Tomcat7调试运行环境搭建与源代码分析入门
- Effective Java: 使用静态工厂方法
- MSComDlg.CommonDialog服务器不能创建对象错误的解决
- mysql远程连接数据库很慢
- JAVA Some Simple Class And Method Use.
- 30、微信-表情相关
- update 值从临时表取
- MSComDlg.CommonDialog服务器不能创建对象错误的解决