I am using a brand new install of Foundation 6 and trying to set up a closable toggle box (http://foundation.zurb.com/sites/docs/toggler.html).
For some reason I am getting this error though..
Uncaught TypeError: Cannot read property '_init' of undefined
on line 245 of foundation.core.js.
This is the HTML on my page, straight from the closable example in the Foundation docs..
<div class="callout" data-closable>
<button class="close-button" data-close>×</button>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore praesentium sint alias dolorum qui vel quaerat, libero consequatur non esse asperiores veritatis commodi, odit eum ipsam nemo dicta iste aliquam.</p>
</div>
This is the javascript I have at the bottom of my HTML before the </body>
.
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/foundation-sites/js/foundation.core.js"></script>
<script src="bower_components/foundation-sites/js/foundation.toggler.js"></script>
<script>
$(document).foundation();
</script>
I'm not sure what I'm doing wrong here or what I'm missing. Everything works if I load the entire Foundation javascript library but that's complete overkill for what I need.
I had this error with multiple plugins from Foundation 6. After doing some searching and reading, it turned out that foundation.core
has a co-dependency with foundation.util.mediaQuery
.
Try inserting foundation.util.mediaQuery
after foundation.core
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With