jQuery3D垂直多级菜单 可筛选菜单项
搜索框可以筛选符合条件的菜单
XML/HTML Code
- <div class="content">
- <div id="jquery-accordion-menu" class="jquery-accordion-menu red">
- <div class="jquery-accordion-menu-header" id="form"></div>
- <ul id="demo-list">
- <li class="active"><a href="#"><i class="fa fa-home"></i>Home </a></li>
- <li><a href="#"><i class="fa fa-glass"></i>Events </a></li>
- <li><a href="#"><i class="fa fa-file-image-o"></i>Gallery </a><span class="jquery-accordion-menu-label">
- 12 </span></li>
- <li><a href="#"><i class="fa fa-cog"></i>Services </a>
- <ul class="submenu">
- <li><a href="#">Web Design </a></li>
- <li><a href="#">Hosting </a></li>
- <li><a href="#">Design </a>
- <ul class="submenu">
- <li><a href="#">Graphics </a></li>
- <li><a href="#">Vectors </a></li>
- <li><a href="#">Photoshop </a></li>
- <li><a href="#">Fonts </a></li>
- </ul>
- </li>
- <li><a href="#">Consulting </a></li>
- </ul>
- </li>
- <li><a href="#"><i class="fa fa-home"></i>系统管理 </a></li>
- <li><a href="#"><i class="fa fa-suitcase"></i>Portfolio </a>
- <ul class="submenu">
- <li><a href="#">Web Design </a></li>
- <li><a href="#">Graphics </a><span class="jquery-accordion-menu-label">10 </span>
- </li>
- <li><a href="#">Photoshop </a></li>
- <li><a href="#">Programming </a></li>
- </ul>
- </li>
- <li><a href="#"><i class="fa fa-user"></i>About </a></li>
- <li><a href="#"><i class="fa fa-envelope"></i>Contact </a></li>
- </ul>
- <div class="jquery-accordion-menu-footer">
- Footer
- </div>
- </div>
- </div>
- <script type="text/javascript">
- (function($) {
- $.expr[":"].Contains = function(a, i, m) {
- return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
- };
- function filterList(header, list) {
- //@header 头部元素
- //@list 无需列表
- //创建一个搜素表单
- var form = $("<form>").attr({
- "class":"filterform",
- action:"#"
- }), input = $("<input>").attr({
- "class":"filterinput",
- type:"text"
- });
- $(form).append(input).appendTo(header);
- $(input).change(function() {
- var filter = $(this).val();
- if (filter) {
- $matches = $(list).find("a:Contains(" + filter + ")").parent();
- $("li", list).not($matches).slideUp();
- $matches.slideDown();
- } else {
- $(list).find("li").slideDown();
- }
- return false;
- }).keyup(function() {
- $(this).change();
- });
- }
- $(function() {
- filterList($("#form"), $("#demo-list"));
- });
- })(jQuery);
- </script>
- <script type="text/javascript">
- jQuery("#jquery-accordion-menu").jqueryAccordionMenu();
- </script>
原文地址:http://www.freejs.net/article_daohangcaidan_567.html