我一直致力于在引导程序的弹出窗口中嵌入交互式元素(搜索功能)。我无法测试它的功能,因为我似乎无法在 javascript 或标记中将事件设置为“单击”而不是“悬停”。我是 js 新手,所以请多多包涵。
<div class="popover-markup"> <a href="#" class="trigger">Search</a>
<div class="head hide">Find an Action</div>
<div class="content hide">
<input class='input-block-level' id='search_address' placeholder='Enter an address or an intersection' type='text'>
<select class='input-small' id='search_radius'>
<option value='400'>2 blocks</option>
<option value='805'>1/2 mile</option>
<option value='1610'>1 mile</option>
<option value='3220'>2 miles</option>
</select>
<h4>Find a School or Campus</h4>
<input class='input-block-level' id='text_search' placeholder="Find a School or Campus" type='text' data-provide="typeahead">
<input class='btn btn-primary' id='search' type='button' value='Search'>
<button class='btn' id='reset'>Reset</button>
</div>
<div class="footer hide">test</div>
这是js:
$('.popover-markup>.trigger').popover({
html : true,
title: function() {
return $(this).parent().find('.head').html();
},
content: function() {
return $(this).parent().find('.content').html();
}
});
任何帮助表示赞赏。谢谢!