問題:表示データの高さがウィンドウの高さよりも高い場合、スクロールすると閉じるアイコンがページから移動します。スティッキーにして、スクロールせずにページを閉じるという選択肢が常にあるようにしたい。基礎6のスティッキークローズボタン
私は基盤6 .sticky
の例を公開してみましたが、私の試みは成功しませんでした。
これは私が考えるべきことだと思いますが、これは公開用コンテナ<div id="modal2" style="height: 100%"></div>
にajax経由でロードされています。残念ながら、閉じるボタンはコンテンツとともにスクロールします。
<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>
私に何かが不足していますか?他の誰かが公開の中でスティッキークローズボタンを得ることができましたか?