Skip to content

Instantly share code, notes, and snippets.

@benjaminfisher
Created February 11, 2012 11:47
Show Gist options
  • Save benjaminfisher/1798939 to your computer and use it in GitHub Desktop.
Save benjaminfisher/1798939 to your computer and use it in GitHub Desktop.
Menu driven by ICanHaz
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>ICanHaz Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://github.com/andyet/ICanHaz.js/raw/master/ICanHaz.min.js"></script>
<script type="text/javascript">
var menu_data = {
"menu": [
{ "name": "first", 'address' : 'http://first.html'},
{ "name": "second", 'address' : 'http://second.html'},
{ "name": "third", 'address' : 'http://third.html'},
{ "name": "fourth", 'address' : 'http://fourth.html'},
{ "name": "fifth", 'address' : 'http://fifth.html'},
]
}
$(function(){
var menu = ich.menu(menu_data);
$("#menu").append(menu);
});
</script>
</head>
<body>
<header>
<nav id="menu"></nav>
</header>
</body>
</html>
<ul>
{{#menu}}
<li><a href={{address}}>{{name}}</a></li>
{{/menu}}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment