jQuery autocomplete suggestion box hidden behind Bootstrap Nav bar

余生颓废 提交于 2020-08-12 03:59:48

问题


I'm using the Bootstrap 4 theme and I've added a jQuery autocomplete search box to it. The problem I'm having though is the top of the suggest box is showing up behind the nav bar. How can I pull this to forefront? Here's the a working example of the problem: https://jsfiddle.net/phenkels/dwhzdg7b/11/. And a snippet of the HTML code:

<body>
  <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" style="margin-bottom: 0">
    <div class="navbar-header">
      <a class="navbar-brand" href="/">DASHBOARD</a>
    </div>

    <!-- Start Search Bar -->
    <div class="ui-widget nav navbar-nav" id="search-wrapper">
      <div class="input-group ">
        <input id="tags" placeholder="Search..." autocomplete=off>
      </div>
    </div>
    <!-- End Search Bar -->

  </nav>
</body>

回答1:


Adding this CSS will increase the z-index:

#ui-id-1 {z-index: 9999;}

Fiddle: https://jsfiddle.net/7z7Lj6pw/

Preview



来源:https://stackoverflow.com/questions/47398178/jquery-autocomplete-suggestion-box-hidden-behind-bootstrap-nav-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!