2014-06-12 2 views

답변

1

시도해보십시오.

HTML을

<a href="#" id="launchModel1">Launch modal 1</a> 

<div id="modal1" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel1" aria-hidden="true"> 
    <div class="modal-dialog modal-lg"> 
    <div class="modal-content"> 
     Modal 1 
    <a href="#" id="launchModel2">Launch modal 2</a> 
    </div> 
    </div> 
</div> 


<div id="modal2" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel2" aria-hidden="true"> 
    <div class="modal-dialog modal-lg"> 
    <div class="modal-content"> 
     Modal 2 
    </div> 
    </div> 
</div> 

자바 스크립트

$("#launchModel1").bind("click", function(){ 
$('#modal1').modal('show'); 
}); 

$("#launchModel2").bind("click", function(){ 
    $('#modal1').modal('hide'); 
    $('#modal2').modal('show'); 
}); 

작동 샘플 - http://www.bootply.com/YR7UREs1Ck

+0

안녕하세요, 잘 작동하고 내 질문에 대답! 나는이 ID가 href에서 얻는 것에 대해 더 생각했다. 그래서 이것은 modal 2를 하드 코딩하지 않고 재사용 될 수있다 ... 문제는 href와 모달 세부 사항을 동시에 캡처하는 것 같다 !! – 72GM

관련 문제