开发者

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,

  1. create a div with id progressbar,
  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜