Twitter bootstrap 通过将鼠标悬停在另一个元素上触发引导工具提示
我试图通过将鼠标悬停在另一个元素上,触发一个引导工具提示出现在一个元素上。我在想,当我将鼠标悬停在我想要触发的元素上时,我可能可以使用JQuery将类添加到我想要显示工具提示的元素上,但这似乎不起作用,因为工具提示没有绑定到hoer伪类 我举了一个例子——在这个例子中,我希望工具提示显示在鼠标悬停在“刷新”按钮(可以工作)上,但也可以悬停在“竖起拇指”按钮上: 其中Twitter bootstrap 通过将鼠标悬停在另一个元素上触发引导工具提示,twitter-bootstrap,tooltip,Twitter Bootstrap,Tooltip,我试图通过将鼠标悬停在另一个元素上,触发一个引导工具提示出现在一个元素上。我在想,当我将鼠标悬停在我想要触发的元素上时,我可能可以使用JQuery将类添加到我想要显示工具提示的元素上,但这似乎不起作用,因为工具提示没有绑定到hoer伪类 我举了一个例子——在这个例子中,我希望工具提示显示在鼠标悬停在“刷新”按钮(可以工作)上,但也可以悬停在“竖起拇指”按钮上: 其中#thumbs是添加的触发器,.resetPrice是带有工具提示的元素,添加以下代码: $('#thumbs').hover(
#thumbs
是添加的触发器,.resetPrice
是带有工具提示的元素,添加以下代码:
$('#thumbs').hover(
function(e){$('.resetPrice').tooltip('toggle');}
);
看
嗯,
-Ted避免子元素出现意外行为的另一种方法
$('.parent-tooltip').hover(
function(e){$(this).find('.child-tooltip').tooltip('show');},
function(e){$(this).find('.child-tooltip').tooltip('hide');}
);
HTML代码段示例:
<span class="parent-tooltip">the Play Store
<span class="child-tooltip" title="Google applications for Android">
<i class="fa fa-google-play"></i></span>
</span> and <span class="parent-tooltip">the App Store
<span class="child-tooltip" title="applications Apple on IOS (iPhone)">
<i class="fa fa-app-store-ios"></i></span>
</span>
游戏商店
还有应用商店