![](/img/trans.png)
[英]bootstrap 4.1.3 dropdown+proper+ scrollable-menu = blinking
[英]Put a box outside the scrollable-menu
我有一個帶有選項的可滾動下拉菜單。 我還有一個搜索框(例如“ CAR”)。 現在,搜索框成為可滾動菜單的一部分,因此當您向下滾動時,搜索框便消失了。 我需要搜索框固定在可滾動菜單的頂部。 因此,基本上我必須將搜索框移出可滾動菜單部分。 問題出在我的javascript代碼中(我的html很好,可以肯定),但是我找不到它,有可能實現我的目標嗎?
我的BOOTPLY ... [BOOTPLY] [1]
只需像這樣更改HTML:
<div class="dropdown-menu brand">
<div style="position: relative;">
<input class="Car" placeholder="Car" type="text">
<div class=" scrollable-menu" style="margin-bottom: 70px;">
<div class="checkbox">
<label><input value="" type="checkbox"> Alpha</label>
</div>
我將<input class="Car" placeholder="Car" type="text">
移到了可滾動菜單div上方,畢竟這是您的HTML。
您還應該像這樣更改變量targetinput:
var targetinput = currentgroup.find('.Car > input[type="text"]');
它現在應該正確選擇您的文本框,這是因為您試圖在類可滾動菜單中找到一個文本框,但是我們將文本框移到了它之外。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.