2017-03-20 15 views
0

現在、私はウェブページの下部にポップアップのようなモーダルを使用しています。モーダルが開いているときにnav-bar、bodyをクリックできません。

<nav class="navbar navbar-default"> 
    <div class="container-fluid"> 
    <div class="navbar-header"> 
     <a class="navbar-brand" href="#">WebSiteName</a> 
    </div> 
    <ul class="nav navbar-nav"> 
     <li class="active"><a href="index.html">Home</a></li> 
     <li><a href="page1.html">Page 1</a></li> 
    </ul> 
    </div> 
</nav> 

<div class="modal fade" id="slide-bottom-popup" data-backdrop="false"> 
    <div class="modal-body"> 
     <button id="close" type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 
     <h4>Cennos Commandments</h4> 
     <ul> 
      <li>Commandments 1</li> 
      <li>Commandments 2</li> 
      <li>Commandments 3</li> 
      <li>Commandments 4</li> 
     </ul> 
    </div><!-- /.modal-body --> 
</div><!-- /.modal --> 

私は身体をクリックするか、選択することができます前に、私は最初のモーダルを閉じるために持っていることを実感モーダル

.modal.fade.in .modal-body { 
    bottom: 0; 
    opacity: 1; 
} 
.modal-body { 
    position: absolute; 
    bottom: -250px; 
    right: 0%; 
    padding: 30px 15px 15px; 
    width: 275px; 
    height: 250px; 
    background-color: #e5e5e5; 
    border-radius: 6px 6px 0 0; 
    opacity: 0; 
    -webkit-transition: opacity 0.3s ease-out, bottom 0.3s ease-out; 
    -moz-transition: opacity 0.3s ease-out, bottom 0.3s ease-out; 
    -o-transition: opacity 0.3s ease-out, bottom 0.3s ease-out; 
    transition: opacity 0.3s ease-out, bottom 0.3s ease-out; 
} 
.close { 
    margin-top: -20px; 
    text-shadow: 0 1px 0 #ffffff; 
} 
body.modal-open { 
    overflow: scroll; 
} 

スクリプトは、ページのロード

$(document).ready(function() { 
setTimeout(function() { 
    $('#slide-bottom-popup').modal('show'); 
}, 0); // milliseconds 
}); 

にそれがオープンにするためのCSSまたはnav-barを押して他のページに移動します。とにかく私はモーダルを開いたままにしておくことができ、同時にボディ、ナビゲーションバーを同時に使用できますか?

私の悪い英語を申し訳ありません。ありがとうございます。

答えて

0

作業フィドルを確認してください:https://jsfiddle.net/NayanaDas/02u302v4/ モーダルクラスを上書きする:

.modal { 
    position: inherit; 
    top: 0px; 
    right: 0px; 
    bottom: 0px; 
    left: 0px; 
    z-index: 1050; 
    display: none; 
    overflow: hidden; 
    outline: 0px; 
} 
+0

私は申し訳ありませんが、モーダルの右側にのみ機能します。モーダルポップアップが中央にある場合は、モーダルの右側をクリックするだけで、左側はまだ無効になっています。 –

+0

@SaoHo:更新された回答を確認してください。これはあなたのために働くことを望みます。 –

+0

ここで動作しています。私はモーダルボックスが開いていても、背景とやりとりすることができます。 –

関連する問題