mdcrtv mdcrtv - 6 months ago 255
Javascript Question

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.

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();

Answer

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