Bootstrap侧面菜单导航问题

时间:2014-11-13 21:26:59

标签: javascript jquery html twitter-bootstrap

我的网站共有5页。其中,2个主页面具有子菜单/页面。

我正在使用+和 - 图标让用户知道网站上有子菜单。

当我点击子菜单时,它会切换+和 - 图标。但是,当我点击+按钮并再次单击第二个+按钮时,前一个子菜单关闭,但图标不会从 - 更改为+。

Jquery的:

if (li.hasClass("open") && li.children("ul:visible").size()) {
        li.children("ul").slideUp().parent('li').removeClass("open");
        li.children("ul").slideUp().parent('li').children("a").children("span").removeClass("open")   ;     
    } else {
        li.children("ul").slideDown().parent('li').addClass("open");
        li.children("ul").slideDown().parent('li').children("a").children("span").addClass("open");
}

html页面结构:

  1. 服务 3.1服务1 3.2服务2
  2. 作品 4.1。 Works1 4.2。作品2
  3. 联系
  4. 我正在使用bootstrap 3.寻找类似于http://startbootstrap.com/template-overviews/sb-admin-2/

    的侧边菜单

1 个答案:

答案 0 :(得分:0)

我通过控制CSS本身来实现它。

相关问题