Solve the scrolling exception when the bootstrap two-layer modal box is hidden
Phenomenon:
Two-layer modal box, the bottom modal box cannot be scrolled after the upper modal box is hidden
Reason:
When the modal box is opened, the scroll bar of the parent label is hidden, and when it is closed, the scroll bar is restored and the scroll bar is added to the parent tag. Therefore, when there are two layers of modal boxes, when the upper layer is closed, the scroll bar is generally added back to body, resulting in the bottom mode box not scrolling.
Solution:
Continue to hide the scroll bar of body while the top modal box is hidden
Code:
$("# frontModal") .on ("hidden.bs.modal", function () {$('body'). AddClass (' modal-open')})