简体   繁体   English

在另一个模态滚动问题上引导模态

[英]Bootstrap modal over another modal Scrolling problem

So I have created a modal in bootstrap in inside this first modal a place a button for opening a second modal.所以我在第一个模态中的引导程序中创建了一个模态,放置一个用于打开第二个模态的按钮。 It works perfectly.它完美地工作。 But when i close the 2nd modal the first modal scroll doesn't work.但是当我关闭第二个模态时,第一个模态滚动不起作用。 Rather if i scroll then the main body scrolled.相反,如果我滚动然后主体滚动。 So How can i solve this.那么我该如何解决这个问题。 有 1 个模态

带 2 个模态

Add to your jQuery Code添加到您的 jQuery 代码

<script>
    $('#id_ofyou_secondary_modal').on('hidden.bs.modal', function (e) {

      $('body').addClass('modal-open');

    });
</script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM