簡體   English   中英

模式關閉后無法在頁面上滾動

[英]cannot scroll on page after modal close

我有一個模型來更新數據。 並且當單擊更新按鈕時,模態關閉,但我無法再在模態關閉后重新加載的頁面上滾動

$(document).off('click','.updatecat');
 $(document).on('click','.updatecat',function(){
    $('#cat-update').ajaxSubmit({ 
        dataType:'json',
        success:function(response){
            if(response.type == 'success'){
                $('#catupdate').modal('hide');
                $('.modal-backdrop').remove()
                $('#taba4').trigger('click');  
            }else{
                alert(response.message);
            }
            alert("Category Updated");
            console.log(response);

        }
    })

 });

我不知道為什么會這樣。 我在其他地方實現了相同的腳本,我可以在模式關閉后滾動頁面。 請幫忙。

刪除下面的行

$('#catupdate').modal('hide');
$('.modal-backdrop').remove()

並添加以下行

if(response.type == 'success'){
   $('#catupdate').hide();
}

暫無
暫無

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

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