时间:2016-01-22 11:08 来源: 我爱IT技术网 作者:佚名
本文所分享的知识点是【jquery实现的一个简单进度条效果实例】,欢迎您喜欢我爱IT技术网所分享的教程、知识、经验或攻略,下面是详细的讲解。
jquery实现的一个简单进度条效果实例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery实现进度条</title>
<style>
.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;}
</style>
<script type="text/jscript" src="http://www.bitscn.com/school/Javascript/201408/jquery.min.js"></script>
<script type="text/javascript">
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);
}
</script>
</head>
<body>
<input type="button" value="开始" onclick="progressBar()" />
<div class="progressBar"><div id="bar"></div></div>
</body>
</html>
关于jquery实现的一个简单进度条效果实例的相关讨论如下:
相关问题:用jquery这个进度条怎么做?
答:下载文件:processbar_20131224180050.html >>详细
相关问题:jquery 进度条,根据指定的值在进度条中显示。各位...
答:其实这个效果并非你想像的是用进度条做的, 它只是换了张图片,让你看到有那样的感觉, 比如说像上面的,没一个选项都是一张图片, 如果用户点击了4,选择满意,即将1,2,3,4的换成彩色图片, 其它的都为灰色,至于用户已选择后,下次还能看到自... >>详细
相关问题:jQuery中animate做进度条效果的疑问
答:给你个思想,做两个 div,一个套一个,修改里面一个高或宽就可以了 >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
