点击后隐藏Bootstrap折叠导航栏按钮?

时间:2016-01-29 01:03:27

标签: twitter-bootstrap navbar collapse

我已经搜寻了我的问题的任何可能原因但是空洞了。我使用Bootstrap并且我有一个折叠的导航栏,当单击时,会在按钮下方生成一条线但不显示菜单。然后,第二次点击它,它会闪烁菜单,但它会很快自动消失,并且不会保持可见状态。

我确定它只是一个简单的修复,但我是新的,所以它对我来说并不那么简单;)寻求一些指导。感谢。

我不确定要在此处发布多少代码和代码,因此我也会将链接放在其中:eci.surge.sh

from theano.tensor.shared_randomstreams import RandomStreams
from theano import function
srng = RandomStreams(seed=234)
rv_u = srng.uniform((2,2))
rv_n = srng.normal((2,2))
f = function([], rv_u)
g = function([], rv_n, no_default_updates=True)    #Not updating rv_n.rng
nearly_zeros = function([], [rv_u, rv_u + rv_u - 2 * rv_u]) # Give rv_u, too

state_after_v0 = rv_u.rng.get_value().get_state()
nearly_zeros()       # this affects rv_u's generator
v1 = f()
rng = rv_u.rng.get_value(borrow=True)
rng.set_state(state_after_v0)
rv_u.rng.set_value(rng, borrow=True)
v2 = f()             # v2 != v1, but equal to rv_u used by nearly_zeros
v3 = f()             # v3 == v1

CSS

<nav id="nav">
    <div class="row">
        <div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
            <a href="#" class="scroll-top"><img src="assets/images/ecsi_logo2.jpg" style="max-height: 50px; padding-top: 7px;" class="center-block" alt="ECI Logo"></a>
        </div>
        <div class="col-lg-10 col-md-10 col-sm-8 col-xs-6 inline-block">
            <nav class="navbar navbar-default navbar-transparent">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <button type="button" id="nav-toggle" class="navbar-toggle" data-toggle="collapse" data-target="#main-nav">
                            <span class="sr-only">Toggle Navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="#"></a>
                    </div>
                    <div id="main-nav" class="collapse navbar-collapse">
                        <ul class="nav navbar-nav navbar-right">
                            <li><a href="#" class="scroll-link" data-id="about"><strong>About</strong></a></li>
                            <li><a href="#" class="scroll-link" data-id="construction"><strong>Construction</strong></a></li>
                            <li><a href="#" class="scroll-link" data-id="environmental"><strong>Environmental</strong></a></li>
                            <li><a href="#" class="scroll-link" data-id="vacuum"><strong>Vacuum Services</strong></a></li>
                            <li><a href="#" class="scroll-link" data-id="coatings"><strong>Coatings</strong></a></li>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
    </div>
</nav>

1 个答案:

答案 0 :(得分:0)

将折叠的类添加到导航切换按钮:

<button type="button" id="nav-toggle" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-nav">