2008-09-20 17:30:51 +00:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="en">
|
2008-07-09 11:09:40 +00:00
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en" />
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>ProgressBar Test Page</title>
|
|
|
|
<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
|
|
|
|
<script type="text/javascript" src="../../ui/ui.core.js"></script>
|
|
|
|
<script type="text/javascript" src="../../ui/ui.resizable.js"></script>
|
|
|
|
<script type="text/javascript" src="../../ui/ui.draggable.js"></script>
|
|
|
|
<script type="text/javascript" src="../../ui/ui.progressbar.js"></script>
|
2008-09-20 04:22:53 +00:00
|
|
|
<script type="text/javascript" src="../../ui/effects.core.js"></script>
|
2008-07-09 11:09:40 +00:00
|
|
|
|
|
|
|
<style type="text/css" media="all">
|
|
|
|
|
|
|
|
body
|
|
|
|
{
|
|
|
|
background: #fff;
|
|
|
|
font-family: Arial;
|
|
|
|
}
|
|
|
|
|
|
|
|
#log {
|
|
|
|
right:0px;
|
|
|
|
top:0px;
|
|
|
|
background-color:#FAFCFE;
|
|
|
|
border:1px solid #DFE8F6;
|
|
|
|
height:400px;
|
|
|
|
width:300px;
|
|
|
|
position:absolute;
|
|
|
|
overflow:auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ProgressBar */
|
|
|
|
|
|
|
|
.ui-progressbar {
|
|
|
|
width: 400px; height: 20px;
|
|
|
|
border: 1px #ccc solid;
|
|
|
|
background:#E0E8F3 url(../images/bg.gif) repeat-x scroll 0%;
|
|
|
|
position:relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui-progressbar-wrap {
|
|
|
|
position: relative;
|
|
|
|
height: auto;
|
|
|
|
width: auto;
|
|
|
|
line-height: 18px;
|
|
|
|
_line-height: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui-progressbar-bar {
|
|
|
|
background:#9CBFEE url(../images/progress-bg.gif) repeat-x scroll left center;
|
|
|
|
border-bottom:1px solid #7FA9E4;
|
|
|
|
border-right:1px solid #7FA9E4;
|
|
|
|
border-top:1px solid #D1E4FD;
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui-progressbar-text {
|
|
|
|
color:#fff;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
font-size: 11px;
|
|
|
|
font-weight: bold;
|
|
|
|
padding-left: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui-progressbar-text-back {
|
|
|
|
color:#000;
|
|
|
|
padding-top: 1px;
|
|
|
|
padding-bottom: 1px;
|
|
|
|
padding-right: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui-progressbar-disabled {
|
|
|
|
opacity:.5;
|
|
|
|
filter:Alpha(Opacity=50);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* custom */
|
|
|
|
.ui-progressbar-text.right-align {
|
|
|
|
text-align: right;
|
|
|
|
padding: 0 5px 0 0;
|
|
|
|
}
|
|
|
|
.ui-progressbar-inner-custom {
|
|
|
|
background: url(../images/custom-bar.gif) repeat-x scroll left center;
|
|
|
|
border-bottom:1px solid #EFEFEF;
|
|
|
|
border-right:0pt none;
|
|
|
|
border-top:1px solid #BEBEBE;
|
|
|
|
height:15px;
|
|
|
|
}
|
2008-08-09 23:06:18 +00:00
|
|
|
.bold {
|
|
|
|
color: red !important;
|
|
|
|
}
|
2008-07-09 11:09:40 +00:00
|
|
|
.ui-hidden {
|
|
|
|
left:-10000px;
|
|
|
|
position:absolute;
|
|
|
|
top:-10000px;
|
|
|
|
visibility:hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body >
|
|
|
|
|
|
|
|
<h1>jQuery - ProgressBar</h1>
|
|
|
|
|
|
|
|
<div id="log">log</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id='p1'></div><br>
|
|
|
|
|
|
|
|
<button id="p1-create">Create</button>
|
|
|
|
<button id="p1-destroy" onclick="$('#p1').progressbar('destroy');">destroy</button>
|
|
|
|
<button id="p1-start" onclick="$('#p1').progressbar('start');">Start</button>
|
|
|
|
<button id="p1-stop" onclick="$('#p1').progressbar('stop');">Stop</button>
|
2008-08-09 23:51:46 +00:00
|
|
|
<button id="p1-stop" onclick="$('#p1').progressbar('pause');">pause</button>
|
2008-07-09 11:09:40 +00:00
|
|
|
<button id="p1-enable" onclick="$('#p1').progressbar('enable');">enable</button>
|
|
|
|
<button id="p1-disable" onclick="$('#p1').progressbar('disable');">disable</button>
|
|
|
|
<button id="p1-progress" onclick="$('#p1').progressbar('progress', 50);">progress to 50</button>
|
|
|
|
<button id="p1-progress" onclick="$('#p1').progressbar('text', 'Textchanged!');">Change text</button>
|
|
|
|
|
|
|
|
<br><br>
|
|
|
|
|
|
|
|
<div id='p2'></div><br>
|
|
|
|
|
|
|
|
<button id="p2-create">Create</button>
|
|
|
|
<button id="p2-destroy" onclick="$('#p2').progressbar('destroy');">destroy</button>
|
|
|
|
<button id="p2-start" onclick="$('#p2').progressbar('start');">Start</button>
|
|
|
|
<button id="p2-stop" onclick="$('#p2').progressbar('stop');">Stop</button>
|
2008-08-09 23:51:46 +00:00
|
|
|
<button id="p2-stop" onclick="$('#p2').progressbar('pause');">pause</button>
|
2008-07-09 11:09:40 +00:00
|
|
|
<button id="p2-enable" onclick="$('#p2').progressbar('enable');">enable</button>
|
|
|
|
<button id="p2-disable" onclick="$('#p2').progressbar('disable');">disable</button>
|
|
|
|
<button id="p2-progress" onclick="$('#p2').progressbar('progress', 40);">progress to 50</button>
|
|
|
|
|
|
|
|
<br><br>
|
|
|
|
|
|
|
|
<div id='p3'></div><br>
|
|
|
|
|
|
|
|
<button id="p3-create">Create</button>
|
|
|
|
<button id="p3-destroy" onclick="$('#p3').progressbar('destroy');">destroy</button>
|
|
|
|
<button id="p3-start" onclick="$('#p3').progressbar('start');">Start</button>
|
|
|
|
<button id="p3-stop" onclick="$('#p3').progressbar('stop');">Stop</button>
|
2008-08-09 23:51:46 +00:00
|
|
|
<button id="p3-stop" onclick="$('#p3').progressbar('pause');">pause</button>
|
2008-07-09 11:09:40 +00:00
|
|
|
<button id="p3-enable" onclick="$('#p3').progressbar('enable');">enable</button>
|
|
|
|
<button id="p3-disable" onclick="$('#p3').progressbar('disable');">disable</button>
|
|
|
|
<button id="p3-progress" onclick="$('#p3').progressbar('progress', $('#p3-value').val());">progress to</button>
|
|
|
|
<input type="text" id="p3-value" value="35"/>
|
|
|
|
|
|
|
|
<br><br>
|
|
|
|
|
|
|
|
<button id="p2-startall" onclick="$('#p2, #p1, #p3').progressbar('start');">Start All</button>
|
|
|
|
<button id="p2-stopall" onclick="$('#p2, #p1, #p3').progressbar('stop');">Stop All</button>
|
2008-08-09 23:51:46 +00:00
|
|
|
<button id="p2-stopall" onclick="$('#p2, #p1, #p3').progressbar('pause');">Pause All</button>
|
2008-07-09 11:09:40 +00:00
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
$(function() {
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
$('#p1-create').click(function() {
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
$('#p1').progressbar({
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
text: 'jQuery ProgressBar waiting...',
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
//addClass: 'ui-progressbar-inner-custom teste',
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
//textClass: 'right-align',
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
//align: 'right',
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-09-20 04:22:53 +00:00
|
|
|
equation: 'easeOutBounce',
|
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
width: 500,
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-09-20 04:22:53 +00:00
|
|
|
duration: 3000,
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-09-20 04:22:53 +00:00
|
|
|
interval: 800,
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-09-20 04:09:27 +00:00
|
|
|
increment: 1,
|
2008-08-09 23:06:18 +00:00
|
|
|
|
|
|
|
progress: function(ui) {
|
2008-07-09 11:09:40 +00:00
|
|
|
//console.log(ui.pixelRange);
|
2008-08-09 23:06:18 +00:00
|
|
|
//console.log(ui);
|
2008-07-09 11:09:40 +00:00
|
|
|
//ui.instance.text('Waiting...');
|
|
|
|
},
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
stop: function(ui) {
|
|
|
|
//console.log('user stop', ui);
|
2008-07-09 11:09:40 +00:00
|
|
|
},
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
start: function(ui) {
|
|
|
|
//console.log('user start', ui);
|
|
|
|
console.log('p1', ui.identifier);
|
2008-07-09 11:09:40 +00:00
|
|
|
}
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
});
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
}).trigger("click");
|
2008-08-08 05:57:52 +00:00
|
|
|
|
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
$('#p2-create').click(function() {
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
$('#p2').progressbar({
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
text: 'Testing...',
|
|
|
|
|
|
|
|
//addClass: 'ui-progressbar-inner-custom teste',
|
|
|
|
|
|
|
|
//textClass: 'right-align',
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
//align: 'right',
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
width: 500,
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
duration: 5000,
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-09-20 04:22:53 +00:00
|
|
|
equation: 'easeInOutQuint',
|
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
interval: 2000,
|
|
|
|
|
|
|
|
increment: 50,
|
|
|
|
|
|
|
|
progress: function(ui) {
|
2008-07-09 11:09:40 +00:00
|
|
|
//console.log(ui.pixelRange);
|
2008-08-09 23:06:18 +00:00
|
|
|
//console.log(ui);
|
|
|
|
//ui.instance.text('Waiting...');
|
2008-07-09 11:09:40 +00:00
|
|
|
},
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
stop: function(ui) {
|
|
|
|
//console.log('user stop', ui);
|
2008-07-09 11:09:40 +00:00
|
|
|
},
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
start: function(ui) {
|
|
|
|
//console.log('user start', ui);
|
|
|
|
console.log('p2', ui.identifier);
|
2008-07-09 11:09:40 +00:00
|
|
|
}
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
});
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-07-09 11:09:40 +00:00
|
|
|
}).trigger("click");
|
2008-08-08 05:57:52 +00:00
|
|
|
|
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
$('#p3-create').click(function() {
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
$('#p3').progressbar({
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
//text: 'Testing again...',
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
//addClass: 'ui-progressbar-inner-custom teste',
|
2008-08-08 05:57:52 +00:00
|
|
|
|
2008-08-09 23:06:18 +00:00
|
|
|
//textClass: 'right-align',
|
|
|
|
|
|
|
|
//align: 'right',
|
|
|
|
|
|
|
|
width: 700,
|
|
|
|
|
|
|
|
duration: 5000,
|
|
|
|
|
|
|
|
interval: 3000,
|
|
|
|
|
|
|
|
increment: 10,
|
|
|
|
|
|
|
|
progress: function(ui) {
|
|
|
|
//console.log(ui.pixelRange);
|
|
|
|
//console.log(ui);
|
|
|
|
//ui.instance.text('Waiting...');
|
|
|
|
},
|
|
|
|
|
|
|
|
stop: function(ui) {
|
|
|
|
//console.log('user stop', ui);
|
|
|
|
},
|
|
|
|
|
|
|
|
start: function(ui) {
|
|
|
|
//console.log('user start', ui);
|
|
|
|
console.log('p3', ui.identifier);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}).trigger('click');
|
2008-07-09 11:09:40 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
if(!window.console) {
|
|
|
|
window.console = {
|
|
|
|
log: function() {
|
|
|
|
$('#log').append(arguments[0]+"<br>");
|
2008-08-08 05:57:52 +00:00
|
|
|
$('#log').scrollTop(999999);
|
|
|
|
}
|
|
|
|
};
|
2008-07-09 11:09:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|