防止移除2个模式之间的滚动

时间:2018-12-05 16:33:35

标签: bootstrap-4 modal-dialog bootstrap-modal

如何防止在2个模式之间删除垂直滚动?

我在屏幕上同时显示2个模态,但是我切换了它的个体。

<div class="modal inmodal fade" id="WaitModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-md">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header bg-danger">
                <button type="button" class="close" data-dismiss="modal"><i class="fas fa-window-close text-white"></i><span class="sr-only">Close</span></button>
                <h4 class="modal-title">Cargando...</h4>
            </div>
            <div class="modal-body">
                <p>
                    Por favor espera un momento a que el Sistema Cargue los elementos o finalizacion del Proceso, Gracias.<br><div class="sk-spinner sk-spinner-wave"><div class="sk-rect1"></div><div class="sk-rect2"></div><div class="sk-rect3"></div><div class="sk-rect4"></div><div class="sk-rect5"></div></div>
                </p>
            </div>
        </div>
    </div>
</div>
<div class="modal inmodal fade" id="ErrorModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header errormdg">
                <button type="button" class="close" data-dismiss="modal"><i class="fas fa-window-close text-white"></i><span class="sr-only">Close</span></button>
                <h4 class="modal-title">Mensaje de Error Del Usuario</h4>
            </div>
            <div class="modal-body"></div>
            <div class="modal-footer">
                <button type="button" class="btn btn-cls-error" data-dismiss="modal">Enviar Error</button>
                <button type="button" class="btn btn-cls-error" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

我使用此脚本显示其个人

$('#WaitModal').modal('show');
$('#ErrorModal').modal('toggle');

当我运行它来隐藏时,请从WaitModalErrorModal中删除所有“垂直滚动”:

$('#WaitModal').modal('hide');

我如何防止从ErrorModal丢失垂直滚动条或保留它。

0 个答案:

没有答案