jquery进度条问题

时间:2011-03-02 20:13:12

标签: jquery

我是jquery的新手,想知道如果进度条= 100,我的jquery代码如何在我的页面上显示图像?

我的代码:

  $(function () {
                   $("Timer1").enableSelection('enable');
                   $("#progressbar").progressbar({ value: 0 });
                   setTimeout(updateProgress, 200);
                 });
    function updateProgress() {
                   var progress;
                   progress = $("#progressbar")
                                  .progressbar("option", "value");
                   if (progress < 100) {
                                $("#progressbar")
                                       .progressbar("option", "value", progress + 2);
                                setTimeout(updateProgress, 200);

我的图片简称为image1。

有什么想法吗?基本上我想显示一个图像,显示任务已经完成。 感谢

1 个答案:

答案 0 :(得分:0)

您应该先将您的图片(指定了id属性)放在DOM中( display:none 不可见),然后使用.show()方法。

要显示的代码应该转到if语句的else部分

if (progress < 100) {
     // whatever you do .....
}
else
{
  $('imgid').show();
}