0

我正在尝试将 offcanvas 添加到我的引导导航中,响应式效果很好,但是当我尝试桌面分辨率时下拉菜单不起作用。

问题似乎是“bootstrap.offcanvas.js”。

当我删除“bootstrap.offcanvas.js”时,它可以工作。

有什么想法可以解决这个问题吗?

    <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
 <div class="container menu-height">
    <div class="navbar-header">
            <button type="button"  class="navbar-toggle offcanvas-toggle pull-right" data-toggle="offcanvas" data-target="#js-bootstrap-offcanvas">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>

                        <a href="https://www.irislink.com" class="navbar-brand"><object width="98px" data="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" title="xxxxxxxxxxxxxxxxxxxxxxxxxxxx" type="image/svg+xml"></object></a>


        </div>
        <!--/.navbar-header -->

        <div class="navbar-offcanvas" id="js-bootstrap-offcanvas">
            <ul class="nav navbar-nav">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">xxxxxxxxx <b class="caret"></b></a>
                    <ul class="dropdown-menu" >
                        <li><a href="#">xxxxx</a></li>
                         <li class="divider"></li>
                        <li><a href="#">xxxxxxxxxx</a></li>
                         <li class="divider"></li>
                        <li><a href="#">xxxxxxxxxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxxxxxxx</a></li>
                    </ul>
                </li>
               <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">xxxxxxxxx<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">xxxxxxxxx</a></li>
                         <li class="divider"></li>
                        <li><a href="#">xxxxxxx</a></li>
                         <li class="divider"></li>
                        <li><a href="#">xxxxxxxxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxxxxxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxxxx</a></li>
                    </ul>
                </li>
               <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">xxxxx <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">xxxxxx</a></li>
                         <li class="divider"></li>
                        <li><a href="#">xxxxxx</a></li>
                         <li class="divider"></li>
                        <li><a href="#">xxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxxx</a></li>
                        <li class="divider"></li>
                        <li><a href="#">xxxxxx</a></li>
                    </ul>
                </li>
                <li class="responsive-online-shop"><div class="box-online-shop"><a class="nav-link btn btn-secondary-outline btn-secondary" href="xxxxxx">xxxxxx</a></div></li>
                <li><div class="box-online-flag"><object data="xxxxxxxxxxxxx" type="image/svg+xml"></object><span class="flag-responsive hidden-lg">xxxxxxx</span></div></li>
            </ul>

        </div>
        <!--/.navbar-collapse -->
        </div>
    </nav>
4

1 回答 1

0

<

  <nav class="navbar navbar-default navbar-offcanvas navbar-offcanvas-touch" role="navigation" id="js-bootstrap-offcanvas">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">Brand</a>
                </div>
                <div>
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="#">Link</a></li>
                        <li><a href="#">Link</a></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" id="js-dropdown-test">Another Link <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li class="divider"></li>
                                <li><a href="#">Separated link</a></li>
                                <li class="divider"></li>
                                <li><a href="#">One more separated link</a></li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" id="js-dropdown-test2">Another Link <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li class="divider"></li>
                                <li><a href="#">Separated link</a></li>
                                <li class="divider"></li>
                                <li><a href="#">One more separated link</a></li>
                            </ul>
                        </li>
                    </ul>
                    <form class="navbar-form navbar-left" role="search">
                        <div class="form-group">
                            <input type="text" class="form-control" placeholder="Search">
                        </div>
                        <button type="submit" class="btn btn-default">Submit</button>
                    </form>
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="#">Link</a></li>
                        <li><a href="#">Another Link</a></li>
                    </ul>
                </div>
            </div>
        </nav>
</header>

nav class="navbar navbar-default navbar-offcanvas navbar-offcanvas-touch" role="navigation" id="js-bootstrap-offcanvas"> 品牌链接

  • 关联
  • 另一个链接
  • 行动
  • 另一个动作
  • 这里有别的东西
  • 单独的链接
  • 另一个单独的链接
  • 另一个链接
  • 行动
  • 另一个动作
  • 这里有别的东西
  • 单独的链接
  • 另一个单独的链接
  • 提交
  • 关联
  • 另一个链接
  • 于 2016-12-07T10:10:33.957 回答