簡體   English   中英

Bootstrap在彈出窗口中提前輸入

[英]Bootstrap typeahead in a popover

我正在嘗試實現bootstrap的預輸入,但是當單擊按鈕時,我試圖使輸入欄出現在彈出窗口上。

彈出窗口內部幾乎具有預輸入功能。

<div id="popover-button-container">
    <button id="popover-button" type="button" class="btn btn-default" 
            data-toggle="popover"
            data-placement="left">${entries.size() - 4} more</button>
            <div id="popover-content" class="hide">
                <input class="typeahead" type="text" placeholder="Search by Artist Name" />
            </div>
</div>

添加JS:

<script>
$("#popover-button").popover({
    html:true,
    content: function(){
        return $('#popover-content').html();
    }
})</script>

但是,預輸入似乎在彈出窗口中不起作用。 如果刪除class = hide部分,則未隱藏的輸入有效,但彈窗中的輸入無效。

想知道是否有人遇到過這個嗎?

任何幫助將是巨大的!

你有嘗試過嗎?

// Constructs the suggestion engine
// Typehead codes here

$('#myPopover').on('show.bs.popover', function () {

  // Initialize your typehead script
  typehead.initilize();

  // Followed by your Typehead codes here...

})

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM