2016-08-17 6 views
-1

이 웹 사이트 http://www.minimit.com/demos/bootstrap-3-transparent-and-fullscreen-modals의 코드를 사용하고 있으며 모달은 작동하지만이를 닫을 수는 없습니다. 버튼이 작동하지 않습니다.부트 스트랩 3 투명하고 전체 화면 모달

내가 놓친 것이 있는지 확인하십시오. 닫기 버튼에 대한 귀하의 data-target="#introModal"

<head> 

    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <meta name="description" content=""> 
    <meta name="author" content=""> 

    <title>Queen Of The Fairies</title> 

    <!-- Bootstrap Core CSS --> 
    <link href="css/bootstrap.min.css" rel="stylesheet"> 

    <!-- Custom CSS --> 
    <link href="css/background.css" rel="stylesheet"> 
    <link href="css/style.css" rel="stylesheet"> 
    <link href="css/font-awesome.min.css" rel="stylesheet"> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> 

    <!--Favicon--> 
    <link rel="apple-touch-icon" sizes="57x57" href="ico/apple-icon-57x57.png"> 
    <link rel="apple-touch-icon" sizes="60x60" href="ico/apple-icon-60x60.png"> 
    <link rel="apple-touch-icon" sizes="72x72" href="ico/apple-icon-72x72.png"> 
    <link rel="apple-touch-icon" sizes="76x76" href="ico/apple-icon-76x76.png"> 
    <link rel="apple-touch-icon" sizes="114x114" href="ico/apple-icon-114x114.png"> 
    <link rel="apple-touch-icon" sizes="120x120" href="ico/apple-icon-120x120.png"> 
    <link rel="apple-touch-icon" sizes="144x144" href="ico/apple-icon-144x144.png"> 
    <link rel="apple-touch-icon" sizes="152x152" href="ico/apple-icon-152x152.png"> 
    <link rel="apple-touch-icon" sizes="180x180" href="ico/apple-icon-180x180.png"> 
    <link rel="icon" type="image/png" sizes="192x192" href="ico/android-icon-192x192.png"> 
    <link rel="icon" type="image/png" sizes="32x32" href="ico/favicon-32x32.png"> 
    <link rel="icon" type="image/png" sizes="96x96" href="ico/favicon-96x96.png"> 
    <link rel="icon" type="image/png" sizes="16x16" href="ico/favicon-16x16.png"> 
    <link rel="manifest" href="/manifest.json"> 
    <meta name="msapplication-TileColor" content="#ffffff"> 
    <meta name="msapplication-TileImage" content="ico/ms-icon-144x144.png"> 
    <meta name="theme-color" content="#ffffff"> 
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> 
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> 
    <!--[if lt IE 9]> 
     <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> 
     <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> 
    <![endif]--> 
    <link href="https://fonts.googleapis.com/css?family=Abel" rel="stylesheet"> 

    <script> 
    $(".modal-fullscreen").on('show.bs.modal', function() { 
     setTimeout(function() { 
     $(".modal-backdrop").addClass("modal-backdrop-fullscreen"); 
     }, 0); 
    }); 
    $(".modal-fullscreen").on('hidden.bs.modal', function() { 
     $(".modal-backdrop").addClass("modal-backdrop-fullscreen"); 
    }); 
    </script> 
</head> 

<body> 
<!--Open Navbar--> 
<nav class="navbar navbar-custom navbar-fixed-top" role="navigation"> 
    <div class="container"> 
    <!-- Brand and toggle get grouped for better mobile display --> 
    <div class="navbar-header"> 
     <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> 
     <span class="sr-only">Toggle navigation</span> 
     <span class="icon-bar"></span> 
     <span class="icon-bar"></span> 
     <span class="icon-bar"></span> 
     </button> 
     <a class="navbar-brand" href="index.html"><img src="logo1.png"></a> 
    </div> 

    <!-- Collect the nav links, forms, and other content for toggling --> 
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 
     <ul class="nav navbar-nav"> 
     <li> 
      <a class="active" data-toggle="modal" data-target="#modal-fullscreen" href="#introModal">INTRO <span class="sr-only">(current)</span></a> 
     </li> 
     <li><a href="#">PRICING</a></li> 
     <li class="dropdown"> 
      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">SERVICES <span class="caret"></span></a> 
      <ul class="dropdown-menu"> 
      <li><a href="#">TAROT CARD</a></li> 
      <li><a href="#">REIKI</a></li> 
      <li><a href="#">AXIOTONAL</a></li> 
      <li><a href="#">HEALING</a></li> 
      <li><a href="#">MASSAGE</a></li> 
      </ul> 
      </li><!--CLOSE DROPDOWN--> 
      <li><a href="#">CONTACT</a></li> 
     </ul> 

     <ul class="nav navbar-nav navbar-right"> 
     <li> 
      <a class="modal-link" data-toggle="modal" data-target="#modal-fullscreen" href="#aboutModal">ABOUT ME</a> 
     </li> 
     </ul> 
    </div><!-- /.navbar-collapse --> 
    </div><!-- /.container-fluid --> 
</nav><!--Close Navbar--> 

<!-- aboutModal fullscreen --> 
<div class="modal modal-fullscreen fade" id="modal-fullscreen" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 
    <div class="modal-dialog"> 
    <div class="modal-content"> 
     <div class="modal-header"> 
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 
     <h4 class="modal-title" id="aboutModal">ABOUT ME</h4> 
     </div> 
     <div class="modal-body"> 
     <img src="images/about_me.jpg" class="img-circle img-responsive center-block"> 
      <p class="text-justify"> 
       My name is Tanja Eklund Almon and I am a gifted healer and psychic reader. I have been doing this for the entirety of my lifetime and I have done readings for a lot of people over the years. I have always had positive responses and experiences. If you require a tarot card reading or would like to relax in complete meditation and immerse yourself in a reiki session. Perhaps you would like to experience an axiotonal realignment, please do not hesitate to call or email me.<br><br>If you require immediate assistance you may click on the chat widget below and I'll be with you shortly...</p><br/> 
     </div> 
     <div class="modal-footer"> 
     <button class="btn btn-primary btn-lg center-block" data-toggle="modal" data-target="#aboutModal" data-dismiss="modal"> OK </button> 
     </div> 
    </div> 
    </div> 
</div> 

<!-- introModal fullscreen -->  
<div class="modal modal-fullscreen fade" id="modal-fullscreen" tabindex="-1" role="dialog" aria-labelledby="introModal" aria-hidden="true"> 
    <div class="modal-dialog"> 
    <div class="modal-content"> 
     <div class="modal-header"> 
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 
     <h4 class="modal-title" id="introModal">ABOUT ME</h4> 
     </div> 
     <div class="modal-body"> 
     <img src="images/fairy.png" class="img-square img-responsive center-block"> 
      <p text-justify>My name actually means "Queen of the Fairies" and out of that idea arose my business name. A colleague once told me that I was primarily attuned to water and that my power was generated from that realm. I am the real thing and sometimes it is scary real. I can truly identify information hidden from the normal senses. The word "psychic" is also used as an adjective to describe these abilities.</p> 
     </div> 
     <div class="modal-footer"> 
     <button class="btn btn-primary btn-lg center-block" data-toggle="modal" data-target="#introModal" data-dismiss="modal"> OK </button> 
     </div> 
    </div> 
    </div> 
</div> 

    <!-- jQuery --> 
    <script src="js/jquery.js"></script> 

    <!-- Bootstrap Core JavaScript --> 
    <script src="js/bootstrap.min.js"></script> 
    <script src="js/scripts.js"></script> 

    <!-- Fullscreen modals JS--> 
    <!-- include jQuery --> 
    <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> 

    <!-- include bootstrap --> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> 

</body> 
<footer id="footer"> 
     <div class="container-fluid"> 
      <div class="row"> 
       <div class="col-sm-12 col-md-12 col-lg-12"> 
        <ul class="social-icons"> 
         <li><a href="https://www.facebook.com/" class="facebook"><i class="fa fa-facebook" style="color: #3b5998;"></i></a></li> 
         <li><a href="https://twitter.com/" class="twitter"><i class="fa fa-twitter" style="color: #00aced;"></i></a></li> 
         <li><a href="https://plus.google.com/" class="google"><i class="fa fa-google-plus" style="color: #dd4b39;"></i></a></li> 
         <li><a href="https://ca.linkedin.com/in/" class="linkedin"><i class="fa fa-linkedin" style="color: #007bb6;"></i></a></li> 
        </ul> 
        <div class="copyright"> 
         <p class="pull-right text-muted small"><a href="http://www.kimosabeit.com">Designed by: Dale Sawanas &copy; Kimosabe IT</a></p><br> 
        </div> 
       </div> 
      </div> 
     </div> 
    </footer> 
</html> 

답변

0

<h4> 태그와하지에 모달의 포장 요소를 가리키고 있습니다.

data-target을 모달의 가장 바깥 쪽 요소 인 #modal-fullscreen으로 변경해보십시오.

+0

@ dgarbacz에 감사드립니다. "모달 바닥 글"div에서 데이터 타겟을 "#introModal"과 "#aboutModal"에서 "# modal-fullscreen"으로 변경했습니다. 링크를 클릭하면 회색 모달이 나타납니다. 버튼을 클릭 할 수 없습니까? – Kimosabe2016

+1

모달에 ID를 설정할 때 고유 한 ID인지 확인해야합니다. #introModal 및 #aboutModal로 다시 변경하십시오. 데이터 타겟이 열거 나 닫는 모달과 일치하는지 확인하십시오. 동일한 ID를 가진 두 개의 요소를 가질 수 없습니다. – dgarbacz

0

코드를 테스트하면 문제가 없습니다. 두 모달이 모두 해결됩니다. 하지만 시도해주세요 ...

<button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> 
+0

이 모달을 시도해보십시오. 원하는 것과 동일한 것이지만, 전체 화면 모달에 대해 CSS 미디어 쿼리를 사용합니다 .... http : //www.smarttutorials.net/full -screen-bootstrap-modal-popup / –