CSS 부트 스트랩의 모달 기능을 사용하고 있으며 완벽하게 작동합니다. 그러나 모달 대화 상자가 열려 있고 나머지 웹 페이지가 .modal-backdrop으로 덮여있는 동안 페이지 구조의 범위 내에서 다른 위치의 외부 요소 중 하나가 될 수있는 기능을 추가하고 싶습니다. 배경으로 상단에 노출 :CSS 부트 스트랩 jquery 모달에서 모달 배경 밖에 요소 노출
위 내 현재 시도에서 볼 수 있듯이<div id="outside-element">
I want this element exposed even while the modal is active,
upon clicking the button in the modal dialog box
</div>
<div id="help-box" class="modal fade" data-backdrop="static" data-keyboard="false" data-show="true" tabindex="-1" role="dialog" aria-labelledby="help-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
Click this button to show the outside element:
<button type="button" class="btn" aria-hidden="true" id="test-item">Click it!</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
(function($) {
$('#test-item').click(function() {
$('#outside-element').attr('style','zIndex:1041');
});
})(jQuery);
</script>
, 나는 .modal - 배경 설정보다 하나 더 높은 1041에 외부 요소의 z 인덱스를하고 있어요 (1040). 이것은 코드가 건전하고 "일하는"(즉, Z- 인덱스를 명확하게 수정하는) 경우에도 내가 원하는 (즉, 모달 배경 위에 # 요소를 배치하는) 것은 아닙니다.
:
여기가 1041
position: relative
의 Z- 인덱스으로 만 배경으로 전면에 외부 요소, 작업 표시하는 바이올린의 (일반적으로 내 코드는 Bootstrap 프레임 워크의 모달 기능에서 더 많거나 적기 때문에) 일반적으로 CSS 부트 스트랩 모달 기능에 적용됩니다. 위의 "위치 : 상대적인"제안을 시도해 보았습니다. 입력에 감사드립니다! – David