- Overview
- Documents
jQuery ListNav will add a slick "letter-based" navigation bar to all of your lists. Click a letter to quickly filter the list to show items that match that letter.
Source: esteinborn.github.io
Apr 23, 2014 in Menu & Accordion 4547 views
jQuery ListNav will add a slick "letter-based" navigation bar to all of your lists. Click a letter to quickly filter the list to show items that match that letter.
Source: esteinborn.github.io
1. INCLUDE CSS AND JS FILES
<link rel="stylesheet" href="css/listnav.css"> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script src="js/jquery-listnav.js"></script>
2. HTML
<ul id="myList"> <li><a href="#">411 Services</a></li> <li><a href="#">Accountants</a></li> <li><a href="#">Accounting</a></li> <li><a href="#">Acupuncture</a></li> <li><a href="#">Advertising</a></li> </ul>
3. JAVASCRIPT
$("#myList").listnav();
4. OPTIONS
$("myList").listnav({ initLetter: '', // filter the list to a specific letter on init ('a'-'z', '-' [numbers 0-9], '_' [other]) includeAll: true, // Include the ALL button incudeOther: false, // Include a '...' option to filter non-english characters by includeNums: true, // Include a '0-9' option to filter by flagDisabled: true, // Add a class of 'ln-disabled' to nav items with no content to show removeDisabled: false, // Remove those 'ln-disabled' nav items (flagDisabled must be set to true for this to function) noMatchText: 'No matching entries', // set custom text for nav items with no content to show showCounts: true, // Show the number of list items that match that letter above the mouse cookieName: null, // Set this to a string to remember the last clicked navigation item requires jQuery Cookie Plugin ('myCookieName') onClick: null, // Set a function that fires when you click a nav item. see Demo 5 prefixes: [], // Set an array of prefixes that should be counted for the prefix and the first word after the prefix ex: ['the', 'a', 'my'] filterSelector: '' // Set the filter to a CSS selector rather than the first text letter for each item });
Tagged with:
listnav
navigation bar
navigation
quickly filter
filter items
items match
filter
bar
jquery listnav
Related Articles