一下是我实现的一个点击button,进度条向前移10%,现在就是我还想再下面添加几个button和进度条怎么添加,点击button不影响其他的button和进度条呢,等待大侠!<html>
<head>
<title>CSS直方图示例</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"> <style type="text/css">
.mb_msgexp li
{
float: left;
line-height: 20px;
}
.mb_msgexp li.step
{
width: 225px;
height: 32px;
padding: 0 0 0 30px;
}
.mb_msgexp .percentImage
{
position: absolute;
width: 192px;
height: 18px;
background-position: 1px 0;
background: url(mybaihe_profile_step.gif) no-repeat 0 0;
background-color:red;
text-align: center;
color: red;
font-weight: 700;
}
</style>
</head>
<body>
<ul class="mb_msgexp">
<li class="online"> </li>
<li>任务进度:已完成</li>
<li id="show" class="step">
<div class="percentImage" style="background-position: 100% 0;">
<div class="bg"> 0%</div>
</div>
</li>
</ul>
<input id="Button1" type="button" value="button" onclick="addcomple()" />
<script type="text/javascript">
var flag=0;
var count=0;
function addcomple()
{
count++;
var r=document.getElementById("Button1");
if(count==1)
{
r.value="111";
}
else if(count ==2)
{
r.value="2222";
}
else if(count==3)
{
r.value="44444";
}
else
{
r.value="333";
}
flag=flag+10;
var show=document.getElementById("show");
if(flag>=100)
{
show.innerHTML="<div class='percentImage' style='background-position: 0% 0;'><div class='bg'>任务完成</div></div>";
return;
}
show.innerHTML="<div class='percentImage' style='background-position: "+(100-parseInt(flag))+"% 0;'><div class='bg'>"+flag+"%</div></div>";
alert(document.getElmentById("show").innerHTML)
}
</script> <br />
<br />
</body>
</html>
<head>
<title>CSS直方图示例</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"> <style type="text/css">
.mb_msgexp li
{
float: left;
line-height: 20px;
}
.mb_msgexp li.step
{
width: 225px;
height: 32px;
padding: 0 0 0 30px;
}
.mb_msgexp .percentImage
{
position: absolute;
width: 192px;
height: 18px;
background-position: 1px 0;
background: url(mybaihe_profile_step.gif) no-repeat 0 0;
background-color:red;
text-align: center;
color: red;
font-weight: 700;
}
</style>
</head>
<body>
<ul class="mb_msgexp">
<li class="online"> </li>
<li>任务进度:已完成</li>
<li id="show" class="step">
<div class="percentImage" style="background-position: 100% 0;">
<div class="bg"> 0%</div>
</div>
</li>
</ul>
<input id="Button1" type="button" value="button" onclick="addcomple()" />
<script type="text/javascript">
var flag=0;
var count=0;
function addcomple()
{
count++;
var r=document.getElementById("Button1");
if(count==1)
{
r.value="111";
}
else if(count ==2)
{
r.value="2222";
}
else if(count==3)
{
r.value="44444";
}
else
{
r.value="333";
}
flag=flag+10;
var show=document.getElementById("show");
if(flag>=100)
{
show.innerHTML="<div class='percentImage' style='background-position: 0% 0;'><div class='bg'>任务完成</div></div>";
return;
}
show.innerHTML="<div class='percentImage' style='background-position: "+(100-parseInt(flag))+"% 0;'><div class='bg'>"+flag+"%</div></div>";
alert(document.getElmentById("show").innerHTML)
}
</script> <br />
<br />
</body>
</html>
解决方案 »
- Gridview绑定到数组,如何让其中一列显示行序号,以及能够如何得到被选的行号?
- 请大家看看这个怎么解决?用指定的ID获得列表的细节,差一点写不出来.
- DropDownList问题
- SELECT选择重复列项的问题
- javascript获取父窗口的值
- .net连接oracle出错,不明白!!
- 如何判定CheckBoxList对象的第一个selected对象,C#实现
- 请教后台改变REPEATER控件中按钮颜色的方法
- 调用DataSet的WriteXML方法为何写入的中文是乱码呢?
- 请问怎么制作Asp.net的安装程序,十万火急!万分感谢!
- 模态窗口不刷新父页面 也能看到添加的效果
- 视频播放功能
<html>
<head>
<title>CSS直方图示例</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"> <style type="text/css">
.mb_msgexp li
{
float: left;
line-height: 20px;
}
.mb_msgexp li.step
{
width: 225px;
height: 32px;
padding: 0 0 0 30px;
}
.mb_msgexp .percentImage
{
position: absolute;
width: 192px;
height: 18px;
background-position: 1px 0;
background: url(mybaihe_profile_step.gif) no-repeat 0 0;
background-color:red;
text-align: center;
color: red;
font-weight: 700;
}
</style>
</head>
<body>
<ul class="mb_msgexp">
<li class="online"> </li>
<li>任务进度:已完成</li>
<li id="show1" class="step" >
<div class="percentImage" style="background-position: 100% 0;">
<div class="bg"> 0%</div>
</div>
</li>
</ul>
<input id="Button1" type="button" value="button" onclick="addcomple(this,'1',0,0)" />
<ul class="mb_msgexp">
<li class="online"> </li>
<li>任务进度:已完成</li>
<li id="show2" class="step">
<div class="percentImage" style="background-position: 100% 0;">
<div class="bg"> 0%</div>
</div>
</li>
</ul>
<input id="Button2" type="button" value="button" onclick="addcomple(this,'2',0,0)" />
<script type="text/javascript"> function addcomple(_this,i,flag,count)
{
count++;
var r=_this;
if(count==1)
{
r.value="111";
}
else if(count ==2)
{
r.value="2222";
}
else if(count==3)
{
r.value="44444";
}
else
{
r.value="333";
}
flag=flag+10;
var show=document.getElementById("show"+i); if(flag>=100)
{
show.innerHTML="<div class='percentImage' style='background-position: 0% 0;'><div class='bg'>任务完成</div></div>";
return;
}
show.innerHTML="<div class='percentImage' style='background-position: "+(100-parseInt(flag))+"% 0;'><div class='bg'>"+flag+"%</div></div>";
alert(document.getElementById("show"+i).innerHTML); _this.onclick=function(){addcomple(_this,i,flag,count);}
}
</script> <br />
<br />
</body>
</html>
怎么点一下就出现警告啊
<div class=bg>10%</div></div>怎么回事啊jol_boy
这句是你自己写的!
alert函数。