我似乎无法透露工作,我已经按照所有内容,添加了现代化,添加插件,添加了css(显示在基础中显示),初始化基础并加载jquery在底部。我错过了什么?
<html>
<head>
<script src="js/custom.modernizr.js"></script>
<script src="js/foundation.min.js"></script>
<link rel="stylesheet" href="css/foundation.css">
<link rel="stylesheet" href="css/foundation.min.css">
<link rel="stylesheet" href="css/normalize.css">
<script>
$(function(){
$(document).foundation();
})
</script>
</head>
<body>
<div id="myModal" class="reveal-modal">
<h2>Awesome. I have it.</h2>
<p class="lead">Your couch. It is mine.</p>
<p>Im a cool paragraph that lives isnside of an even cooler modal. Wins</p>
<a class="close-reveal-modal">×</a>
</div>
<a href="#" class="big-link" data-reveal-id="myModal" id="my-trigger">
Fade and Pop
</a>
</body>
<script>
document.write('<script src=/js/vendor/'
+ ('__proto__' in {} ? 'zepto' : 'jquery')
+ '.js><\/script>');
</script>
</html>
触发模态$('#my-trigger')。触发器('click');就像那里:Revealing a Modal in Foundation 4也没有帮助。
答案 0 :(得分:1)
在我的构建中,javascript位于页脚之后(除了modernizr)。我创建了一个测试页面,类似于您如何设置以尝试重新创建问题。尝试移动
<script src="js/foundation.min.js"></script>
<script>
$(function(){
$(document).foundation();
})
</script>
到你的
之后<script>
document.write('<script src=/js/vendor/'
+ ('__proto__' in {} ? 'zepto' : 'jquery')
+ '.js><\/script>');
</script>