Feature : I made a live menu search
See original GitHub issueMy menu end up with long list so I thought I shall use that search box to search menu. And may be someone find this useful too.
-
- I added a class to the search box
<input type="text" name="q" class="form-control search-menu-box" placeholder="Search...">
-
- Added this jQuery script
$(".search-menu-box").on('input', function() {
var filter = $(this).val();
$(".sidebar-menu > li").each(function(){
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
$(this).hide();
} else {
$(this).show();
}
});
});
Based on the codes from this link http://www.designchemical.com/blog/index.php/jquery/live-text-search-function-using-jquery/
Issue Analytics
- State:
- Created 8 years ago
- Reactions:6
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Search from the iPhone Home Screen or Lock Screen
On iPhone, you can search for apps and contacts, content in apps like Mail, Messages, and Photos, and even text in your photos...
Read more >Google rolls out new features across Maps, Search and ...
Google rolls out new features across Maps, Search and Shopping · Google's dish search feature · Google's search with live view feature.
Read more >See what's on the Start menu - Microsoft Support
Learn more about the Start menu, including how to find your files and get to your apps and programs. ... Next, make it...
Read more >Customize YouTube channel layout - Google Support
Under Video spotlight, click ADD and select a video to feature. Click Publish. ... Search Help Center ... Search. Clear search. Close search....
Read more >How to find movies and TV shows using Roku® Search
From the latest blockbusters and trending shows to your favorite cult classics, Roku Search includes 500000+ movies and TV episodes across a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The code snippet seems to have problem when making search box empty i.e. all multi-level menu items remain open. In addition the rightmost arrows are not working as expected. Can anyone if possible provide the rectified solution to this?
If you would like the search to include child items, simply replace
to