Yii2 BS4 showOnUpscroll不起作用

时间:2018-08-07 10:21:49

标签: html yii yii2

我已经将Yii2更新为BS4。当我向下滚动页面时,导航栏菜单正确地被隐藏,但是当我向上滚动页面时,导航栏菜单未显示。似乎选项“ showOnUpscroll”设置为false,但是我没有在插件初始化中指定它。仅当我在开始时滚动页面时,才会显示导航栏菜单。我也尝试指定“ showOnUpscroll:true”,但没有任何改变。

插件初始化:

$('。navbar-fixed-top')。autoHidingNavbar({showOnBottom:false});

我的菜单:

<nav id="w0" class="navbar-inverse navbar-fixed-top navbar-expand-md navbar-dark bg-dark collapse show navbar" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggler hidden-sm-up" data-toggle="collapse" data-target="#w0-collapse"><span class="sr-only">Toggle navigation</span>
                &#9776;</button>
            <a class="home-link navbar-brand" href="/DesignazioniProject/Designazioni/web/index.php?r=site%2Fhome">
                <img class="logo" src="/DesignazioniProject/Designazioni/web/css/images/whistle.png" alt="">Designazioni
                <div class="logo_beta">Beta</div>
                <div class="welcome_message">Ciao, Cristian</div>
            </a>
        </div>
        <div id="w0-collapse" class="collapse navbar-toggleable-xs">
            <ul id="w1" class="nav">
                <li class="home-link nav-item"><a class="nav-link" href="/DesignazioniProject/Designazioni/web/index.php?r=site%2Fhome"><i class="fas fa-home" style="padding-right: 10px"></i>Home</a></li>
                ...
                ...
                ...
            </ul>
        </div>
    </div>
</nav>

0 个答案:

没有答案