[英]Twitter bootstrap tooltip on chosen-select not working
Did anyone succeed in adding a tooltip on chosen-select
box? 有没有人成功地在
chosen-select
框上添加了工具提示? I created a jsFiddle to demonstrate the problem. 我创建了一个jsFiddle来演示该问题。
This is the relevant code: 这是相关代码:
$('body').tooltip({ selector: '.chosen-select', animate: true, delay: 400, placement: 'right', trigger: 'click hover focus manual', });
My guess why this doesn't work, is because the select
tag has a style of display: none
. 我的猜测为什么不起作用,是因为
select
标记具有一种display: none
样式display: none
。
The problem is you weren't initializing the tooltip properly. 问题是您没有正确初始化工具提示。 You must have the
data-toggle="tooltip" title="Some tooltip text!"
您必须具有
data-toggle="tooltip" title="Some tooltip text!"
attributes on any element to make a tool tip work properly. 属性上的任何元素,以使工具提示正常工作。 I also changed which element you were binding the tooltip too.
我还更改了绑定工具提示的元素。
See fiddle. 见小提琴。 http://jsfiddle.net/e62Wu/50/
http://jsfiddle.net/e62Wu/50/
HTML HTML
<select class="chosen-select" data-toggle="tooltip" title="Some tooltip text!">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
JS JS
$('.chosen-container').tooltip({
animate: true,
delay: 400,
placement: 'right',
trigger: 'click hover focus manual'
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.