上传栏与实际进度不同步。我该怎么办?

时间:2013-08-13 11:39:13

标签: javascript jquery

以下是我的代码:

 <script type="text/javascript">
            window.onload = function ()
             {
                hideProgress();
            }
            function showProgress()
            {
                $(function ()
             {
                    $("#dialog-modal").dialog(
                     {
                        height: 70,`
                        width: 450,
                        modal: true,
                        resizable: false
                    });
                    $(".ui-dialog-titlebar").hide();
                    $("#progressbar").progressbar({
                        value: 0
                    });
                });

                updateProgessBar();
            }

       function hideProgress()
       {
            $("#dialog-modal").dialog('close');
        }
        function updateProgessBar() {
            var currentProgress = $("#progressbar").progressbar("value");
            currentProgress = currentProgress + 2;
            $("#progressbar").progressbar("value", currentProgress);
            if (currentProgress < 10) {
                var temp = setTimeout("updateProgessBar();", 500);
            }
            else if (currentProgress >= 10 && currentProgress < 30) {
                var temp = setTimeout("updateProgessBar();", 1000);
            }
            else if (currentProgress >= 30 && currentProgress < 45) {
                var temp = setTimeout("updateProgessBar();", 1500);
            }
            else if (currentProgress >= 45 && currentProgress < 60) {
                var temp = setTimeout("updateProgessBar();", 2000);
            }
            else if (currentProgress >= 60 && currentProgress < 80) {
                var temp = setTimeout("updateProgessBar();", 2500);
            }
            else if (currentProgress >= 80 && currentProgress < 95) {
                var temp = setTimeout("updateProgessBar();", 3000);
            }
            else if (currentProgress >= 95) {

            }
        }
        function CheckValidation() {
            if (Page_ClientValidate()) {
                // Call Your custom JS function and return value.
                showProgress();
                return true;
            }
            else {
                return false;
            }
        }

    </script>

0 个答案:

没有答案