jquery进度条
2015-11-06 15:53
609 查看
<span style="font-size:18px;"><!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>jquery 进度条</title> <meta name="description" content=""> <meta name="keywords" content=""> <link href="" rel="stylesheet"> <style> *{margin: 0;padding: 0;} .progs { width: 1000px; margin: 0 auto; text-align: center; margin-top: 200px; } #progress { width: 800px; height: 15px; position: relative; border: 1px solid #336688; margin: 0 auto; } #curr { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: orange; } .showper { height: 25px } </style> </head> <body> <div class="progs"> <p class="showper">0%</p> <div id="progress"><div id="curr"></div></div> <input type="button" value="开始"> </div> <script src="http://cdn.bootcss.com/jquery/2.1.0/jquery.js"></script> <script type="text/javascript"> var i=0; $(function(){ $("input[type='button']").one("click",calcper); }); function calcper(event){ var aa=setInterval(function(){ var curwidth=$("#curr").width(); if(i>=100){ clearInterval(aa); event.target.value="完成"; } $("#curr").width(i*8); $(".showper").html(i+"%"); i++; },10); } </script> </body> </html></span>
相关文章推荐
- jQuery jQuery on()方法
- jQuery Mobile样式加载问题
- Jquery AutoComplete的使用方法实例
- JQuery技巧
- jquery easyui 添加按钮逻辑,未渲染
- jquery取消和绑定事件
- Jquery -- JQuery对象操作(附对应JS方法)
- 共有25款 jQuery自动完成插件开源软件
- 对jquery val 获取input 文本框值进行扩展
- Jquery系列问题
- jquery判断checkbox是否被选中
- JQuery EasyUI Tree
- jQuery中的text()、html()和val()以及javascript中的innerText、innerHTML和value
- jQuery获取字符串末尾字符
- jQuery的简易在线客服
- js、jquery常用
- jQuery:插件开发步骤
- jQuery:插件开发小例
- jQuery插件实现静态HTML验证码校验
- jQuery Real Person验证码插件防止表单自动提交