簡體   English   中英

進度條完成后禁用按鈕和啟用按鈕?

[英]disabled button and enabled button when progress bar finish?

如何在進度條工作時禁用按鈕當進度條完成時,按鈕啟用。

我的代碼不起作用按鈕在開始時沒有禁用。 謝謝。

<div id="progressTimer"></div>

<script>
    function () {
        $("#btnSave").attr('disabled', 'disabled');
    };
</script>

<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://www.jqueryscript.net/demo/Easy-jQuery-Progress-Bar-Timer-Plugin-For-Bootstrap-3-progressTimer/js/jquery.progressTimer.js'></script>
<script>



            $("#progressTimer").progressTimer({
                timeLimit: 30,
                warningThreshold: 10,
                baseStyle: 'progress-bar-warning',
                warningStyle: 'progress-bar-danger',
                completeStyle: 'progress-bar-info',
                onFinish: function () {
                    $("#btnSave").removeAttr('disabled');
                }
            });



</script>


<input type="button" value="Save" id="btnSave" />
<div id="progressTimer">
</div>

我希望按鈕被禁用,直到進度條結束。 進度條完成后啟用按鈕

要啟用/禁用按鈕使用:

$('#btnSave').prop('disabled', false);
$('#btnSave').prop('disabled', true);`

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM