关于悬停和焦点的Twitter Bootstrap工具提示

RLe*_*ger 7 javascript tooltip twitter-bootstrap

Twitter引导工具提示触发器默认是悬停.

我可以添加data-trigger ="focus"以使工具提示显示在焦点上,但我如何同时进行悬停和聚焦?

blu*_*oft 6

你有没有尝试过 data-trigger="focus hover"


Dmi*_*try 5

@Adrian的解决方案在Bootstrap 3上不起作用.使用以下内容:

$('[rel=tooltip]').tooltip();
$(document).on('hover', '[rel=tooltip]', function () { $(this).tooltip('show'); });
$(document).on('focus', '[rel=tooltip]', function () { $(this).tooltip('show'); });
Run Code Online (Sandbox Code Playgroud)