1

I'm concatenating Foundation 6's core.js, util.mediaQuery.js, and equalizer.js files. In the source code, the source order is jquery first, then foundation.core.js, util.mediaQuery.js, and the plug-in file, per the documentation. I also compile their JS to ECMAScript 2015, using Babel per Zurb's docs.

This error occurs with util.mediaQuery.js included:

Uncaught TypeError: Foundation.onImagesLoaded is not a function(…)

This error occurs without util.mediaQuery.js included:

Uncaught TypeError: Cannot read property '_init' of undefined

I'm not sure it's relevant to include the snippets these errors reference. According to Zurb's documentation for Equalizer: "The file foundation.equalizer.js must be included in your JavaScript to use this plugin, along with foundation.core.js.".

And, true to form, you'd need to visit a different page within their docs to read that "if you're only using certain plugins, know that they all require foundation.core.js and foundation.util.mediaQuery.js to be loaded first".

Despite the nebulous direction provided by Zurb's docs, one of the two above scenarios should produce a functioning plug-in rather than an error.

Any insight as to why it's occurring is greatly appreciated.

  • Does this work when you are using the Complete Foundation 6 package? I just attempted to cut the cruft out of my javascript by removing unneeded foundation plugins using their own http://foundation.zurb.com/sites/download.html/#customizeFoundation page and got the same types of errors. – NuclearPeon Oct 19 '16 at 23:56
  • @NuclearPeon The error doesn't occur if you bring in the single js that includes all plugins and dependencies. My scenario was the same as yours -- just trying to shave down as much as possible. – jivers Dec 04 '16 at 21:07

1 Answers1

0

Go to http://foundation.zurb.com/sites/download.html/#customizeFoundation and select the following options for your custom build:


enter image description here


I'm writing a web application and only using the Equalizer plugin. It appears the Tabs container is a required dependency.

NuclearPeon
  • 5,743
  • 4
  • 44
  • 52