モーダル フォームを使用した次の基本的な Foundation 6 セットアップは機能しています。つまり、モーダルフォームが画面に表示されると、ブラウザのサイズを変更すると適切にサイズ変更されます。
<!doctype html>
<html>
<head>
<title>modal test</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="css/foundation.min.css">
<script type="text/javascript" src="js/vendor/jquery.min.js"></script>
</head>
<body>
<div id="headerContainer">
<a href="#" class="button" data-open="modalForm">Show Modal</a>
</div>
<div id="modalContainer">
<!-- start: modalForm content -->
<div class="reveal" data-reveal id="modalForm" role="dialog" >
<div class="row" >
<div class="medium-12 large-12 columns">
<p>modal test</p>
<button class="close-button" data-close aria-label="Close reveal" type="button"> <span aria-hidden="true">×</span> </button>
</div>
</div>
</div>
<!-- end: modalForm content -->
</div>
<script src='js/foundation.min.js'></script>
<script>
//$("#modalContainer").load("_form-modal-test.html", function() {
$(document).foundation();
//});
</script>
</body>
</html>
コンテンツを外部ファイルに配置すると、以下の例のようにロードされます。モーダル フォームのサイズが適切に変更されなくなりました。
<!doctype html>
<html>
<head>
<title>modal test</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="css/foundation.min.css">
<script type="text/javascript" src="js/vendor/jquery.min.js"></script>
</head>
<body>
<div id="headerContainer">
<a href="#" class="button" data-open="modalForm">Show Modal</a>
</div>
<div id="modalContainer"></div>
<script src='js/foundation.min.js'></script>
<script>
$("#modalContainer").load("_form-modal-test.html", function() {
$(document).foundation();
});
</script>
</body>
</html>
動的にロードされたときにモーダルフォームを適切に応答させる方法を知っている人はいますか?