How to show progress bar in adobe air app?
I'm trying to show a progress bar in adobe air app, but having problems. I'm using jquery ui progress bar, but the progress bar isn't being shown and I don't know why. I'm trying the simple example shown in the jquery demo site,
- create a div with id progressbar,
- using this command
$( "#progressbar" ).progressbar({ value: 59 });
I would assume the progress bar should would show up but I get nothing. Any help?
Just to show some code:
<!DOCTYPE html>
<html>
<head>
<script type = "text/javascript" src = "js/jquery-1.5.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.9.custom.min.js"></script开发者_如何转开发>
<script>
var count = 50;
startProgress();
function startProgress()
{
$( "#progressbar" ).progressbar({
value: count
});
}
</script>
</head>
<body>
<div>
<div id="progressbar" ></div>
</div>
</body>
</html>
Enclose your script in a ready handler. This will cause the script to execute after the DOM is ready, instead of immediately (before the progressbar
div exists in the DOM.)
$(document).ready(function() {
var count = 50;
$( "#progressbar" ).progressbar({
value: count
});
});
Note that I removed the startProgress()
function declaration, as its unnecessary.
精彩评论