Foundation 5 modal not working

css, javascript, zurb-foundation

Solution

Put the call to foundation.reveal.js before you call `$(document).foundation();`.

I'm pretty sure this is because `$(document).foundation();` initiates only those modules that have been specified prior to it, something that Foundation doesn't make clear in its notes.

Foundation offers you options to customize plugin initialization. By default, calling $('#scope').foundation(); will initialize all available plugins on the page.

Problem

I'm sure I'm making a silly mistake but it took me hours and I couldn't find any solution for my problem. Everything seems ok but not working. I'm using Foundation 5 reveal. But modal window does not show. Here is my code: HTML ``` <a class="openModal" href="#" data-reveal-id="imagemodal"><img src="image.jpg" /></a> <div id="imagemodal" class="reveal-modal" data-reveal>Modal</div> ``` I've also included the following js files in body tag: ``` <script type="text/javascript" src="js/foundation/foundation.js"></script> <script> $(document).foundation(); </script> <script type="text/javascript" src="js/foundation/foundation.reveal.js"></script> ``` Any help is appreciated in advance.

Original source