Download
User Rating: 0/5 ( 0 votes)
navToSelect is jQuery plugin used to convert your website navigation into a select drop-down menu for small screen devices.
Source: github.com
1. INCLUDE JS FILES
<script src="jquery.js"></script>
<script src="dist/jquery.navToSelect.min.js"></script>
2. HTML
<nav id="nav">
<ul>
<li><a href="homepage.html">Homepage</a></li>
<li><a href="about.html" class="active">About us</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
3. JAVASCRIPT
jQuery(function($) {
$("#nav > ul").navToSelect({
activeClass: 'active',
indentString: '–',
defaultText: 'Navigate to...'
});
});
4. CSS
.nav2select { display: none; }
/* Mobile device */
@media only screen and (max-width: 767px) {
#nav > ul { display: none; }
.nav2select { display: block; }
}