当我尝试使用可选配置时,Foundation 6(6.2.3)均衡器停止工作 [英] Foundation 6 (6.2.3) Equalizer stops working when I try to use optional configurations
问题描述
我有一个依赖基金会的网站.
I've got a site that relies on foundation.
一切正常,直到我添加此处.
Everything works great, until I add the optional javascript configurations documented here.
特别是:
equalize_on_stack: false
这给了我这个错误:
foundation.js:1 Uncaught TypeError: We're sorry, object is not a valid parameter. You must use a string representing the method you wish to invoke.
这在我的页脚文件中:
$(document).ready(function(){
$(document).foundation({
equalizer : {
equalize_on_stack: false,
}
});
});
我要定位的元素如下所示:
And the elements I'm targeting look like this:
<div class="box-group" data-equalizer>
<div class="medium-6 columns text-center" data-equalizer-watch>
stuff and things
</div>
<div class="medium-6 columns text-center" data-equalizer-watch>
things and stuff
</div>
</div>
jquery会加载到标头中,并且均衡器会起作用,如果我这样初始化的话:
jquery is loaded in the header and equalizer does work if I initialize it like this:
$(document).ready(function(){
$(document).foundation();
});
也许我缺少一些简单的东西.如果外面有人可以看看并帮助我弄清楚为什么"equalize_on_stack"不起作用,我将不胜感激.
Maybe I'm missing something simple. If anyone out there can take a look and help me figure out why "equalize_on_stack" doesn't work, I'd really appreciate it.
===解决了它===
感谢Shoaib Iqbal,我能够使它正常工作.
Thanks to Shoaib Iqbal, I was able to get it working.
结果是,我参考了版本6的Foundation 5文档.
Turns out, I was referencing the foundation 5 documentation for version 6.
我能够通过添加以下内容解决问题:
I was able to solve the problem by adding:
data-equalize-on-stack="false"
像这样:
<div class="box-group" data-equalizer data-equalize-on-stack="false">
我在页脚中所需要的就是:
All I needed in my footer was this:
$(document).foundation();
推荐答案
您做错了,您没有传递插件名称,它应该包含equalizer
You are doing it wrong, you are NOT passing the plugin name, it should have equalizer
in it
$(document).foundation({
equalizer : {
equalize_on_stack: false,
}
});
这篇关于当我尝试使用可选配置时,Foundation 6(6.2.3)均衡器停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!