简体   繁体   English

使用按钮切换引导导航栏

[英]Toggle bootstrap navbar using button

How to hide navbar while clicking a button? 如何在单击按钮时隐藏导航栏? I have tried the following, but it is not working. 我已经尝试了以下方法,但是它不起作用。

<b:commandButton 
    value="New User" 
    onclick="$('.nav').toggle();"
    actionListener="#{loginController.openRegistrionPopup}"/>  

尝试

onclick="function(){$('.nav').toggle(); return false;}"

Try this: 尝试这个:

DEMO: DEMO:

 $("#btn").click(function () {
            $("#nav").toggle("bounce");
        });

I have tried this. 我已经试过了。 Working fine. 工作正常。

   <a data-toggle="collapse" data-target=".navbar-ex1-collapse">
      <b:commandButton value="New User" look="link" ajax="true" 
                       actionListener="#{loginController.openRegistrionPopup}" 
                       immediate="true" size="xs" update="registration" />   
    </a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM