Vote count:
0
I'm currently evaluating Zurb Foundation and tried to create a top bar with a menu. Somehow the links in my dropdown menus didn't work so I went basic:
I downloaded the zip, took their index.html and replaced the contents with the example from the top bar documentation. After removing everything that's unnecessary for the example, I got this:
<!doctype html>
<html class="no-js" lang="en">
<head>
<title>Foundation | Welcome</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
</head>
<body>
<nav class="top-bar" data-topbar role="navigation">
<section class="top-bar-section">
<ul class="right">
<li class="has-dropdown">
<a href="#">Go to</a>
<ul class="dropdown">
<li><a href="http://www.google.com">Google</a></li>
<li><a href="http://www.yahoo.com">Yahoo!</a></li>
</ul>
</li>
</ul>
</section>
</nav>
<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>
This works: the menu opens (on hover) and I can click the links. But if I remove the JavaScript initialization
$(document).foundation();
the menu still opens (but now only after a click and not a hover) and when I hover the menu entries, the status bar shows the appropriate links but clicking on them doesn't do anything.
I thought we were over that that we need JavaScript for the most basic things. I mean we can even do animations without JavaScript nowadays but here I can't even open a link? Am I doing something wrong or is this really intended behavior? As a NoScript user this would be a no go for me.
Does top bar work without JavaScript in Zurb Foundation 5?
Aucun commentaire:
Enregistrer un commentaire