Suyesh Bhatta
Suyesh Bhatta

Reputation: 151

cannot scroll on page after modal close

i have a model to update data. and when the update button is clicked the modal closes but i can no longer scroll on the page that reloads after the closing of modal

$(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);

        }
    })

 });

I have no idea why this is happening. i have implemented the same script elsewhere and i can scroll on page after modal closes. please help.

Upvotes: 1

Views: 433

Answers (1)

Shankar S Bavan
Shankar S Bavan

Reputation: 962

remove below line

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

and add below line

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

Upvotes: 1

Related Questions