0
問題:當顯示數據高於窗口高度時,滾動會將關閉圖標移出頁面。我想讓它變得粘稠,以便您始終可以選擇關閉頁面而不必滾動回頂部。基礎6粘性關閉按鈕顯示
我曾嘗試將基礎示例6 .sticky
加載到顯示中,但我的嘗試都沒有成功。
這是我認爲應該工作,它通過ajax加載到揭示容器<div id="modal2" style="height: 100%"></div>
。不幸的是,關閉按鈕只是滾動內容。
<script>
// this script cannot be located in the layouts.js,
// because the trigger doesn't exist at page load.
$('#close-modal2').click(function(){
// $('#modal2').foundation('close'); didn't work for some reason.
// 'open' closes all other modals, so it accomplishes what I need.
$('#modal').foundation('open');
});
</script>
<div>
<button id="close-modal2" class="close-button sticky"
aria-label="Close reveal" type="button" data-sticky>
<span aria-hidden="true">×</span>
</button>
</div>
<div id="paragraph-wrapper" data-sticky-container>
<div class="row">
<div class="small-11 small-centered columns">
<div> Lots of content here, enough to overflow window...</div>
<div> Losts of content here..... etc.</div>
</div>
</div>
</div>
我錯過了什麼嗎?其他人是否能夠在揭密中獲得粘性關閉按鈕?