自定义进度条
来源:互联网 发布:Android悬浮窗源码 编辑:程序博客网 时间:2024/06/07 12:17
很头疼的进度条!!!
前台代码
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"><title></title>
<script language="javascript" type="text/javascript">
function set() { //用来设置进度条的长度
var obj, Mywidth;
obj = document.getElementById("processbar");
Mywidth = obj.style.width;
Mywidth = Mywidth.replace("px", "");
Mywidth = parseInt(Mywidth); Mywidth++;
obj.style.width = Mywidth + "px";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="padding: 1px; background-color: #E6E6E6; border: 1px solid #C0C0C0; width: 300px; height: 20px;">
<div id="processbar" style="background-color: #00CC00; height: 18px; width: 1px;">
</div>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click"/>
</form>
</body>
</html>
后台代码
protected void Button1_Click(object sender,EventArgs e)
{
int i;
string s="<script>";
for(i=0;i<300;i++)
{
s+="set();";
s=s+"</script>";
ClientScript.RegisterStartupScript(ClientScript.GetType(),s+ i,s);
}
}
注:还有一点小bug:后台在前台注册script脚本的时候会在页面显示一大堆的脚本执行命令。
本人能力不足有哪位牛人看到后能否给找一下原因所在,谢谢。
阅读全文
0 0
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- 自定义进度条
- Shredding Company
- sql语句合集大全(个人总结)
- 2010-2011 ACM-ICPC, NEERC, Southern Subregional Contest E
- Xamarin.Forms 基础——Behavior+EffectBehavior
- 自己动手写操作系统:1.cpu中寄存器、汇编语言及其它基础知识
- 自定义进度条
- QT pro文件解析
- hdu 1151 Air Raid
- 阿里云服务器安装WordPress,搭建自己的博客网站
- POJ-1733Parity game
- 树状数组-随笔
- Xamarin.Forms 基础——Behavior——EventToCommandBehavior
- 二叉树的深度
- 大一最后一次正式比赛有感