如何启动progressbar事件jquery mobile
如果我使用这个脚本和css文件如何启动progressbar事件jquery mobile,jquery,Jquery,如果我使用这个脚本和css文件 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>progressbar</title> <link href="../../Content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>progressbar</title>
<link href="../../Content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui.min.js")"> </script>
<script type="text/javascript">
$(document).ready(function () {
alert('hi');
$("#progressbar").progressbar({ value: 70 });
});
</script>
</head>
<body>
<div id="progressbar">
</div>
</body>
</html>
这些样式用于进度条。所以我把它们复制到了jquery.mobile-1.0rc2.css
但是在jquery ui.min.js中进行了一些调用,以应用progressbar样式
那么,如何在不添加这些文件的情况下完成这项任务呢
有什么帮助吗
提前感谢。请完成以下示例。您可以在任何事件上调用这些函数。这只是为了在移动平台上填充进度条,您可以根据需要进行自定义。 此外,您还必须添加2个JS和一个CSS来填充进度栏 您可以导入上面链接中给出的JS和CSS文件,然后在Android WebApp上使用下面的代码
$(function() {
$("#progressbar").progressbar({ value: 10 });
setTimeout(updateProgress, 500);
});
function updateProgress() {
var progress;
progress = $("#progressbar")
.progressbar("option","value");
if (progress < 100) {
$("#progressbar")
.progressbar("option", "value", progress + 5);
setTimeout(updateProgress, 500);
}
}
$(函数(){
$(“#progressbar”).progressbar({value:10});
设置超时(updateProgress,500);
});
函数updateProgress(){
var进展;
进度=$(“#进度条”)
.progressbar(“期权”、“价值”);
如果(进度<100){
$(“#进度条”)
.progressbar(“期权”、“价值”、进度+5);
设置超时(updateProgress,500);
}
}
这将在延迟半秒后以5的增量移动进度。您可以根据需要进行修改
希望这对你有帮助
亲切问候,
总结
.ui-widget {
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
font-size: 1.1em/*{fsDefault}*/;
}
.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
.ui-progressbar { height:2em; text-align: left; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
$(function() {
$("#progressbar").progressbar({ value: 10 });
setTimeout(updateProgress, 500);
});
function updateProgress() {
var progress;
progress = $("#progressbar")
.progressbar("option","value");
if (progress < 100) {
$("#progressbar")
.progressbar("option", "value", progress + 5);
setTimeout(updateProgress, 500);
}
}