本文介绍了选择2,带有引导程序弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试在select2 4.0.1上设置bootstrap 3.5 popover,但似乎不起作用:
I try to set a bootstrap 3.5 popover on select2 4.0.1, but it seems it does not working:
<input id="sampleInput" type="text" rel="popover" data-content="This is the body of Popover" data-original-title="Creativity Tuts" data-placement="auto" data-trigger="hover" />
<p/>
<select id="selectb" data-content="This is the body of Popover" data-original-title="Creativity Tuts" data-placement="auto" data-trigger="hover" data-container="body">
<option>Please select ...</option>
<option value="1">Select2</option>
<option value="2">Chosen</option>
<option value="4">selectize.js</option>
<option value="6">typeahead.js</option>
</select>
js:
$(function () {
$('#sampleInput').popover();
$('#selectb').popover();
$('#selectb').select2();
});
可以在 http://jsfiddle.net/s4w1z09v/
有何评论?!
推荐答案
作为一种解决方法;您可以尝试:
As a workaround; you could try:
<input id="sampleInput" type="text" rel="popover" data-content="This is the body of Popover" data-original-title="Creativity Tuts" data-placement="auto" data-trigger="hover" />
<p/>
<span id="selectb-popover"
data-content="This is the body of Popover"
data-original-title="Creativity Tuts"
data-placement="auto"
data-trigger="hover"
data-container="body">
<select id="selectb">
<option>Please select ...</option>
<option value="1">Select2</option>
<option value="2">Chosen</option>
<option value="4">selectize.js</option>
<option value="6">typeahead.js</option>
</select>
</span>
并将您的js更新为:
$(function () {
$('#sampleInput').popover();
$('#selectb').select2();
$('#selectb-popover').popover();
});
这篇关于选择2,带有引导程序弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!