2013-06-24 2 views
0

나는 트위터 부트 스트랩을 사용하고 있으며 모달 팝업 창을 여는 링크가 있습니다. 이제 모달 자체에서 다른 모달 팝업을 열고 싶습니다.Twitter Bootstrap : 모달에서 모달로 전환

문제는이 다른 모달이 열리지 만 이전 모달도 여전히 열려 있다는 것입니다. 또한 동일한 효과 (배경이 50 % 더 어두워 짐)가 다시 적용되어 배경이 모두 검은 색으로 표시됩니다.

누구나 해결책을 알고 있습니까?

답변

1

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title></title> 
    <link href="Styles/bootstrap.css" rel="stylesheet" type="text/css" /> 

</head> 
<body> 
    <input type="button" name="name" class="btn btn-danger" value="open first modal" onclick="$('#modal1').modal('show')"/> 
    <div class="modal hide fade" id="modal1"> 
     <div class="modal-header"> 
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> 
       &times;</button> 
      <h3> 
       Modal 1 header</h3> 
     </div> 
     <div class="modal-body"> 

      <a onclick="$('#modal1').modal('hide');$('#modal2').modal('show');" class="btn btn-success">Open Second modal</a> 

     </div> 
     <div class="modal-footer"> 
      <a href="#" class="btn">Close</a> <a href="#" class="btn btn-primary">Save changes</a> 
     </div> 
    </div> 
    <div class="modal hide fade" id="modal2"> 
     <div class="modal-header"> 
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> 
       &times;</button> 
      <h3> 
       Modal 2 header</h3> 
     </div> 
     <div class="modal-body"> 
      <p> 
       One fine body…</p> 
     </div> 
     <div class="modal-footer"> 
      <a href="#" class="btn">Close</a> <a href="#" class="btn btn-primary">Save changes</a> 
     </div> 
    </div> 
    <script src="Scripts/jquery-1.10.1.min.js" type="text/javascript"></script> 
    <script src="Scripts/bootstrap.js" type="text/javascript"></script> 

</body> 
</html> 
+0

당신을 감사하십시오! 그러나 "onclick"은 진짜 ​​좋은 해결책입니까? – Vay