samedi 28 février 2015

Foundation navigation top-bar not working

I have an HTML template file which uses Spring MVC + thymeleaf and I'm trying to create a navigable menu at the top of the page using Foundation's "top-bar" component.


So far, the menu bar is displayed but menus are not being shown when the cursor is placed on top.


I can display the sub-menus related to my main menu options (the ones placed at the bar) but sub-menus are not working because when I click an option on the first sub-menu, the menu closes instead of displaying another sub-menu.


My HTML file looks like this:



<!DOCTYPE html>
<html xmlns:th="http://ift.tt/wfNV60">
<head>
<link rel="stylesheet" type="text/css" media="all" th:href="@{/css/foundation.min.css}" />
</head>
<body>
<nav class="top-bar" role="navigation" data-topbar="true">
<ul class="title-area">
<li class="name">
</li>
<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a>
</li>
</ul>

<section class="top-bar-section">
<ul class="left">
<li class="divider"></li>
<li class="has-dropdown"><a href="#"><span th:text="#{menu.administration}"></span></a>
<ul class="dropdown">
<li class="has-dropdown"><a href="#"><span th:text="#{menu.administration.material}"></span></a>
<ul class="dropdown">
<li><a href="#"><span th:text="#{menu.administration.ontology}"></span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</section>
</nav>

<div>
<div class="large-12 columns">
<h2 th:text="#{material.search.title}"></h2>
</div>
</div>

<script th:href="@{/js/vendor/jquery.js}"></script>
<script th:href="@{/js/foundation.min.js}"></script>
<script th:href="@{/js/foundation/foundation.topbar.js}"></script>
<script th:href="@{/js/vendor/modernizr.js}"></script>

<script>
jQuery(document).ready({
jQuery(document).foundation();
});
</script>

</body>
</html>


I'm sure my resources are being properly imported.


Also, I had to use data-topbar="true" because if I use data-topbar only, my page fails while rendering saying it a expecting for a = after the property name.


Am I doing something wrong?


Thank you so much for any help guys!


Aucun commentaire:

Enregistrer un commentaire