动态引导工具提示不会在手动触发时显示
Dynamic Bootstrap tooltip won't show on manual triggering
似乎不会使用以下方法触发带有工具提示的动态创建的元素: $(this).tooltip('show');
我做错了什么?
在线复制
<div class="not-editable">
<span>Click here</span>
</div>
.JS:
//dynamic tooltip
$('body').tooltip({
selector: '.not-editable .to-edit',
placement: 'bottom',
trigger: 'manual',
title: 'Actual times cannot be given as the trip is not confirmed',
template: '<div class="tooltip error-tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
});
//dynamic added element...
setTimeout(function(){
$('.not-editable').find('span').addClass('to-edit');
}, 1000);
//Trying to trigger the tooltip
$(document).on('click', '.to-edit', function(){
console.log("showing...");
$(this).tooltip('show');
});
实际更改
trigger: 'manual',
自
trigger: 'click | hover',
(与删除它一样多)也可以像:
https://jsfiddle.net/kj9sxnrc/4/
在引导工具提示文档中,它说
如何触发工具提示 - 单击 | 悬停 | 焦点 | 手动。您可以传递多个触发器;用空格分隔它们。
manual
不能与任何其他触发器结合使用。
相关文章:
- Highcharts-在单击而不是悬停时显示工具提示
- C3.js通过单击按钮显示工具提示
- 未单击按钮时显示工具提示
- 高图表在点单击时显示工具提示
- Flexslider-当鼠标悬停在点上时显示工具提示
- 高亮显示工具提示共享项,具体取决于Highcharts中悬停的系列
- 显示工具提示而不双击字段
- 在 Twitter 引导程序中自动显示工具提示,而无需放置光标
- 悬停时显示工具提示
- 隐藏 x 轴标签,但在图表.js中显示工具提示
- 突出显示工具提示中未显示名称的 3D 散点
- 如何在图像库森时更改颜色和显示工具提示
- q提示 2 - 鼠标按下以显示工具提示?鼠标向上隐藏
- D3.js水平折线图无法正确显示工具提示
- 在 d3.js 折线图中永久显示工具提示
- 如何在 SVG 上的鼠标光标旁边显示工具提示,尽管网站上有非 SVG 元素
- 高图表在类别标签悬停时显示工具提示
- 仅在完全创建时显示工具提示
- 鼠标输入时未显示工具提示
- 鼠标悬停时无法显示工具提示,jQuery1.11