Foundation 6 (6.2.3) Equalizer stops working when I try to use optional configurations

╄→尐↘猪︶ㄣ 提交于 2019-12-13 20:07:18

问题


I've got a site that relies on foundation.

Everything works great, until I add the optional javascript configurations documented here.

Specifically:

equalize_on_stack: false

That give me this error:

  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.

This is in my footer file:

$(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 is loaded in the header and equalizer does work if I initialize it like this:

$(document).ready(function(){
    $(document).foundation();
});

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.

=== SOLVED IT ===

Thanks to Shoaib Iqbal, I was able to get it working.

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"

like so:

<div class="box-group" data-equalizer data-equalize-on-stack="false">

All I needed in my footer was this:

$(document).foundation();

回答1:


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,
  }
});


来源:https://stackoverflow.com/questions/37647992/foundation-6-6-2-3-equalizer-stops-working-when-i-try-to-use-optional-configur

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!