0
나는 실행을 시도 할 때 유효성 검사를 위해 팝업을 활성화 할 것이라는 모달을 가지고 있습니다. 3 초 후에 숨기기 위해 팝업 오버 타임을 추가했습니다. 그러나 모달을 닫으면 타임 아웃 기능이 멈춘 것처럼 보이고 팝 오버는 숨기지 않고 직접 숨기기를 말하더라도 작동하지 않습니다.부트 스트랩 모달 팝 오버 닫을 때 숨기기
모달 HTML
모달options = {
content: raw_data.errors,
html: true,
placement: 'top',
trigger: 'manual'
}
$('#password_modal_save').popover(options);
$('#password_modal_save').popover('show');
setTimeout(function(){ click.popover('hide'); }, 3000);
모달 가까운 리스너 내부
<div class="modal hide fade" id ="password_modal"> <div class="modal-header"> <h3>Change Password <span class="extra-title muted"></span></h3> </div> <div class="modal-body form-horizontal"> <div class="control-group"> <label for="current_password" class="control-label">Current Password</label> <div class="controls"> <input type="password" name="current_password"> </div> </div> <div class="control-group"> <label for="new_password" class="control-label">New Password</label> <div class="controls"> <input type="password" name="new_password"> </div> </div> <div class="control-group"> <label for="confirm_password" class="control-label">Confirm Password</label> <div class="controls"> <input type="password" name="confirm_password"> </div> </div> </div> <div class="modal-footer"> <button href="#" class="btn" data-dismiss="modal" aria-hidden="true">Close</button> <button href="#" class="btn btn-primary" id="password_modal_save">Save changes</button> </div> </div>
$("body").on("hidden", "#password_modal", function(event){
$(this).remove(); //Remove the modal to stop duplications
$('#password_modal_save').popover('hide'); //Targetting the popover directly
$('.popover').remove(); //Last solution to actually hiding it
});
나는 호피 해요 NG는 $('.popover').remove();
바이올린 이외의 팝 오버 숨길 수있는 깨끗한 방법을 : 2.1.0을 사용하여 http://jsfiddle.net/La2yn/20/
당신이 당신의 HTML을 게시 할 수 모달을 닫는 중지뿐만 아니라 다음 코드
추가를 -.- 모달을 폐쇄했다 .. – PSL
모달에 대한 html을 추가했습니다 – Bankzilla
http://jsfiddle.net/La2yn/을 만들 수 있습니까? 아마도 마크 업을 업데이트하면 모달이 열립니다. – PSL