내 모달 직접 사용한 코드의 부트스트랩이 사례, 부스스트라피제스 아닌 bootstrap-modal.js) 에만 포함되어 있다. 하지만, 내 밑에 그레이요 페이드할 (배경) 이며 다른 모달 는 비사양 editable.
[2] 의 [이 바이올린] 운행에서어떠한 지켜보리니 재현할 수 있도록 한 이 문제가 발생합니다. 이 코드는 다음과 같은 기본 구조를
<body>
<p>Lorem ipsum dolor sit amet.</p>
<div class="my-module">
This container contains the modal code.
<div class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">Modal</div>
</div>
</div>
</div>
</div>
</body>
body {
padding-top: 50px;
}
.my-module {
position: fixed;
top: 0;
left: 0;
}
이것이 왜 내가 이 문제를 해결 할 수 있는 또는 아무 생각 없어?
모달 컨테이너입니다 고정되어 있는 경우 또는 상대 포지셔닝하십시오 요소에 고정 또는 상대 포지셔닝하십시오 아니면 이 비헤이비어를 발생합니다.
다음은 몇 가지 방법이 있습니다.
문제가 있는 모 컨테이너입니다 포지셔닝도 할 수있다. &Quot move", 쉽게 할 수 있습니다. 이러한 컨테이너입니다 디스플레이하여 전에 너회의 모달 빠져 있습니다. # 39 의 경우 어떻게 해야 here& 조교하실 '쇼' ing 너회의 모달 flexlm*용 js:
$('#myModal').appendTo("body").modal('show');
또는, 모달 버튼을 사용하여 시작하면 드롭합니다 스모달 (& # 39, show& # 39;), ',' 및 'just do.
$('#myModal').appendTo("body")
이 모든 기능을 사용할 수 있도록 새벽꺼정 일반적인 모달 표시하십시오 버튼를.
또한, css, js 있는지 버전니다 부트스트랩에 수준들과 같습니다. 모달 나타나는 여러 가지 버전을 만들 수 있는 배경:
예를 들면 다음과 같습니다.
나쁜:
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
좋은:
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
또한 이 문제가 발생할 수 있는 솔루션을 보유하고 있으며 어떤 협력했습니다 가져다줄래요 전까진 솔직히, t need a # 39 깨달았습니다 don& 진입한다. 이에 따라 다음의 코드를 통해 쉽게 제거할 수 있습니다.
<div class="modal fade" id="createModal" data-backdrop="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4>Create Project</h4>
</div>
<div class="modal-body">Not yet made</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
[1]: https://getbootstrap.com/docs/3.3/javascript/ # 조동사 옵션
솔루션 공급자 @Muhd 이를 위한 가장 좋은 방법입니다. 그러나 이처럼 갇혀 있을 경우 구조 변경 옵션이 없는 상황에서, 이 기법을 사용하여 페이지의.
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="false" style="background-color: rgba(0, 0, 0, 0.5);">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">...</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
< /div>;
'에서 이 트릭 슬라이드에서는 이에 따라 데이터 = " false"; style = ", 배경색: rgba (0, 0, 0, 0.5), 이에 따라 만들고, '* " 제거하여 기본값입니다 설정하여 더미 (dummy) 와 일부 대화상자의 배경색입니다 자체가 하나의 알파.
업데이트 1:* 그 배경을 언약보다는 대화상자의 닫으십시오 클릭하면 @Gustyn 의해 지적한 대로 그대로 나왔다. 따라서 자바 스크립트 코드가 추가 할 수 있다. 다음은 이 일부 들어 어떻게 얻을 수 있습니다.
$('.modal').click(function(event){
$(event.target).modal('hide');
});
그러나 일반 솔루션을 슬라이드에서는 여기있을 하지만 한 말 -
var checkeventcount = 1,prevTarget;
$('.modal').on('show.bs.modal', function (e) {
if(typeof prevTarget == 'undefined' || (checkeventcount==1 && e.target!=prevTarget))
{
prevTarget = e.target;
checkeventcount++;
e.preventDefault();
$(e.target).appendTo('body').modal('show');
}
else if(e.target==prevTarget && checkeventcount==2)
{
checkeventcount--;
}
});
이 링크에서 자세한 내용은 - https://stackoverflow.com/questions/21126617/bootstrap-3-modal-disappearing-below-backdrop-when-using-a-fixed-sidebar/21127348 # 21127348.
이것은 또 다른 방법은 '에서' 의 부스스트라피크스트 .modal-backdrop 분리하십시오 z-인덱스 이로 인해 같은 수준을 수 있는 가운데 나머지 몸 (그래도 여전히 페이드할) 에 있는 양상, 당신의 지켰다.
'' .modal-backdrop 모양입니다
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #000000;
}
이 같은 배경 등을 위한 CSS 에서 사용할 때 문제가 될 수 있는 경험이 종종 그래디언트 심지어 아코디언 헤더도.
Css 수정 또는 재정의을 핵심 부트스트랩에 죄송합니다. 있으며, 원치 않는 부작용은요 주관업체로 바람직하지 않다. 하지만, ',' 주는 것이 가장 외곽진입 추가 이에 따라 데이터 = " false" 작업자쪽에서 페이드할 효과를 볼 수 있습니다 더 이상 정상적으로 작동합니다.
최근 이 문제를 해결할 수 없는 것 같다, 버전 3.3.5 정보정의다음 후 由대 利덈 부트스트랩에 원치 않는 부작용은요.
다운로드: https://github.com/twbs/bootstrap/releases/download/v3.3.5/bootstrap-3.3.5-dist.zip
Css 파일과 JavaScript 에서 3.3.5 파일을 포함해야 합니다.
그럼 난 이미 아아아안녀어엉 같은 문제가 있다는 것을 사용할 때 부스스라프 3.1 이전 버전의 부스스라프 달리 (2.3.2) html 구조를 모달 변경되었습니다!
<div class="modal hide fade">
<div class="modal-dialog">
<div class="modal-content">
**here goes the modal header body and footer**
</div>
</div>
</div>
I have a 가볍고 더 나은 솔루션이.
.modal-backdrop { 디스플레이 컨투어로 없음. 숨겨짐, 가시도로: 상대적 위치: }
2 세트 '를 배경으로' 블랙 반투명 스모달 배경 이미지입니다.
스모달 { background: http://bin.smwcentral.net/u/11361/BlackTransparentBackground.png" url (";) 구글 이미지 영상을 반투명 // z 인덱스화할 1100년; }
이렇게 하면 가장 효과적으로 사용할 수 있도록 하는 경우 요구 사항이 아니라, ',' < 요소를 인사이드라면 모달 근처에 /body> 태그이고,
그러나 이 기술은 어느 누구도 나를 위해 제안된 솔루션 그들위에 협력했습니다 문제를 해결했습니다.
$('#myModal').on('shown.bs.modal', function() {
//To relate the z-index make sure backdrop and modal are siblings
$(this).before($('.modal-backdrop'));
//Now set z-index of modal greater than backdrop
$(this).css("z-index", parseInt($('.modal-backdrop').css('z-index')) + 1);
});