문제

I'm trying to implement responsive collapsing navbar Bootstrap 2.3.2.When window width is narrow navbar is collapsing and button with class btn-navbar appears. What I want is to have the ability to call this collapsing function manually from JavaScript when a certain action happens.

I cannot understand where in bootstrap.js window resizing is being watched and how the collapse function is called.

Here is a code of my navbar:

<div class="navbar navbar-fixed-top" id="pantry_header">
<div class="navbar-inner">
    <div class="container">
        <a class="btn btn-navbar" data-toggle="collapse" data-target=".navbar-responsive-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>
        <div class="logo_wrapper">
            <img src="./../public/img/logo_op.png" width="133px" height="40px">
        </div>
        <div class="nav-collapse collapse navbar-responsive-collapse">
            <ul class="nav pull-right">
                <li class="control local"><a id="link_user_experience">USER EXPERIENCE</a></li>
                <li class="control local"><a id="link_restocking">RESTOCKING EXPERIENCE</a></li>
                <li class="control local"><a id="link_analytics">ANALYTICS</a></li>
                <li class="control local"><a id="link_team" href="company">COMPANY</a></li>
                <li class="hide form_wrapper" id="header_form">
                    <div style="margin-left: 0px;"><input type="text" placeholder="Name" name="name"/></div>
                    <div><input type="text" placeholder="E-mail" name="email"/></div>
                    <div class="button_wrapper">
                        <div class="green_btn button">
                            <div class="button_text white_font">Learn More</div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</div>
</div>

What bootstrap function I should call to hide <ul> with class nav, show navigation button, and put navigation link in the dropdown menu?

올바른 솔루션이 없습니다

다른 팁

The window size is calling using Media queries, media queries check for your window size and it calls the appropriate function.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top