Best way to add “current” class to nav in Rails 3

后端 未结 24 1756
天涯浪人
天涯浪人 2020-11-29 15:05

I have some static pages in a navigation menu. I want to add a class like \"current\" to the item which is currently displaying.

The way I am doing so is to add tons

24条回答
  •  失恋的感觉
    2020-11-29 15:43

    For me personally i used a combination of answers here

  • Menu
  • I am using materialize css and my way of making the main categories collapsible is by using the code below

    $('.active').closest(".collapsible.collapsible-accordion")
                .find(".collapsible-header")
                .click();
    

    hope it helps someone

提交回复
热议问题