Foundation does not work anything that uses Javascript

-1

I am loading in the JQuery header, foundation.min.js and foundation.css. But nothing that requires JavaScript works, like dropdown , slider , etc. I can not find a solution anywhere. How do Foundation work?

<html>
<head>
    <meta charset="utf-8">
    <title>Test Foundation</title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <link rel="stylesheet" href="foundation/css/foundation.min.css">
    <script src="foundation/js/foundation.min.js"></script>
</head>
<body>

<div class="row">
<div class="medium-6 columns">

<a href="#" data-dropdown="drop1" class="button dropdown">Dropdown Button</a><br>
<ul id="drop1" data-dropdown-content class="f-dropdown">
<li><a href="#">This is a link</a></li>
<li><a href="#">This is another</a></li>
<li><a href="#">Yet another</a></li>
</ul>

</div>
</div>

</body>
</html>

The dropdown button does not work, although everything is loading normally. The code is identical to documentation .

    
asked by anonymous 16.04.2014 / 19:58

2 answers

1

It seems like you forgot to initialize the foundation. Put this just before </body> , and dropdown will work:

<script>$(document).foundation();</script>
    
17.04.2014 / 23:17
1

Try to put the javascript's at the bottom of the page, before closing the Body tag. Below you do the foundation initialization:

<script>$(document).foundation();</script>

If it still does not work, include the individual JS dropdown file as it appears in its documentation on the Foundation .

<script src="foundation/js/foundation.dropdown.js"></script>

Adjust the file path if necessary.

    
22.04.2014 / 19:35