开发者

How to show progress bar in adobe air app?

开发者 https://www.devze.com 2023-03-18 02:58 出处:网络
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 examp

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

精彩评论

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

关注公众号