Bootstrap Modals keep adding padding-right to body after closed

后端 未结 30 1991
南方客
南方客 2020-12-12 12:36

I am using bootstrap and Parse framework to build a small webapp. But those Bootstrap modals keep adding padding-right to body after closed. How to solve this?

I tri

30条回答
  •  无人及你
    2020-12-12 12:57

    It occurs when you open a modal that previous modal is not completely closed yet. To fix it just open new modal at the time that all modal are completely closed, check codes below:

      showModal() {
        let closeModal = $('#your-modal');
    
        closeModal.modal('hide');
        closeModal.on('hidden.bs.modal', function() {
          $('#new-open-modal').modal('show');
        });
      }
    

提交回复
热议问题