求救 asp.net & JQuery
时间:2014-02-18
来源:互联网
我现在的问题是 为何 单click 不能引发 progressbar function而是双click?
希望有好心人能解答, 谢谢!!!!!!!
<head runat="server">
<title></title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<style type="text/css">
.ui-progressbar {
position: relative;
}
#progressbar
{
position:fixed;
z-index: 100;
top:60%;
width:100%;
height:50px;
font-weight: bold;
}
.progress-label {
float: left;
margin-left: 50%;
z-index: 100;
margin-top: 5px;
font-weight: bold;
height: 30px;
font-size:14pt;
}
</style>
<script type="text/javascript" >
$(document).ready(function () {
$("#<%=Button1.ClientID %>").click(function () {
var progressbar = $("#progressbar"), progressLabel = $(".progress-label");
progressbar.progressbar({
value: false,
change: function () {
progressLabel.text(progressbar.progressbar("value") + "%");
},
complete: function () {
progressLabel.text("Complete!");
progressbar.progressbar.css("display", "none");
}
});
function progress() {
var val = progressbar.progressbar("value") || 0;
progressbar.progressbar("value", val + 1);
if (val < 99) {
setTimeout(progress, 100);
}
}
setTimeout(progress, 1000);
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button"/>
<div id="progressbar">
<div class="progress-label">Loading...</div>
</div>
</form>
</body>
Loading...
[ 本帖最后由 saturn1022 於 2013-10-25 10:48 AM 编辑 ]
希望有好心人能解答, 谢谢!!!!!!!
<head runat="server">
<title></title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<style type="text/css">
.ui-progressbar {
position: relative;
}
#progressbar
{
position:fixed;
z-index: 100;
top:60%;
width:100%;
height:50px;
font-weight: bold;
}
.progress-label {
float: left;
margin-left: 50%;
z-index: 100;
margin-top: 5px;
font-weight: bold;
height: 30px;
font-size:14pt;
}
</style>
<script type="text/javascript" >
$(document).ready(function () {
$("#<%=Button1.ClientID %>").click(function () {
var progressbar = $("#progressbar"), progressLabel = $(".progress-label");
progressbar.progressbar({
value: false,
change: function () {
progressLabel.text(progressbar.progressbar("value") + "%");
},
complete: function () {
progressLabel.text("Complete!");
progressbar.progressbar.css("display", "none");
}
});
function progress() {
var val = progressbar.progressbar("value") || 0;
progressbar.progressbar("value", val + 1);
if (val < 99) {
setTimeout(progress, 100);
}
}
setTimeout(progress, 1000);
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button"/>
<div id="progressbar">
<div class="progress-label">Loading...</div>
</div>
</form>
</body>
Loading...
Loading...
Loading...
[ 本帖最后由 saturn1022 於 2013-10-25 10:48 AM 编辑 ]
作者: saturn1022 发布时间: 2014-02-18
你post 埋 client site D Code出黎啦, 因为 asp.net 系有可能会改变 button ID架.
作者: wingwell 发布时间: 2014-02-18
no client -side /behind code
[ 本帖最后由 saturn1022 於 2013-10-25 10:49 AM 编辑 ]
[ 本帖最后由 saturn1022 於 2013-10-25 10:49 AM 编辑 ]
作者: saturn1022 发布时间: 2014-02-18
用browser view code 睇返html code喎
作者: wingwell 发布时间: 2014-02-18
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28