Permalink
Switch branches/tags
Find file
517bc8c Jun 30, 2014
@viljamis @szepeviktor @kadimi
71 lines (57 sloc) 1.84 KB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>TinyNav.js &middot; Convert navigation to a tiny select box on small screen</title>
<style>
/* styles for desktop */
.tinynav { display: none }
#nav .selected a, #nav2 .selected a { color: red }
/* styles for mobile */
@media screen and (max-width: 600px) {
.tinynav { display: block }
#nav, #nav2 { display: none }
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="tinynav.min.js"></script>
<script>
$(function () {
// TinyNav.js 1
$('#nav').tinyNav({
active: 'selected',
indent: '',
label: 'Menu'
});
// TinyNav.js 2
$('#nav2').tinyNav({
header: 'Navigation' // Writing any title with this option triggers the header
});
});
</script>
</head>
<body>
<h1>TinyNav.js</h1>
<ul id="nav">
<li><a href="http://google.com">Google</a></li>
<li class="selected"><a href="demo.html">Demo page</a></li>
<li><a href="http://bing.com">Bing</a>
<ul>
<li><a href="http://google.com">Google</a></li>
<li><a href="demo.html">Demo page</a></li>
<li><a href="http://bing.com">Bing</a></li>
<li><a href="http://yahoo.com">Yahoo</a></li>
</ul>
</li>
<li><a href="http://yahoo.com">Yahoo</a></li>
</ul>
<ul id="nav2">
<li><a href="http://google.com">Google</a></li>
<li><a href="demo.html">Demo page</a></li>
<li class="selected"><a href="http://bing.com">Bing</a></li>
<li><a href="http://yahoo.com">Yahoo</a></li>
</ul>
<p><a href="http://tinynav.viljamis.com/">See the documentation</a></p>
</body>
</html>