Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 通过将鼠标悬停在另一个元素上触发引导工具提示_Twitter Bootstrap_Tooltip - Fatal编程技术网

Twitter bootstrap 通过将鼠标悬停在另一个元素上触发引导工具提示

Twitter bootstrap 通过将鼠标悬停在另一个元素上触发引导工具提示,twitter-bootstrap,tooltip,Twitter Bootstrap,Tooltip,我试图通过将鼠标悬停在另一个元素上,触发一个引导工具提示出现在一个元素上。我在想,当我将鼠标悬停在我想要触发的元素上时,我可能可以使用JQuery将类添加到我想要显示工具提示的元素上,但这似乎不起作用,因为工具提示没有绑定到hoer伪类 我举了一个例子——在这个例子中,我希望工具提示显示在鼠标悬停在“刷新”按钮(可以工作)上,但也可以悬停在“竖起拇指”按钮上: 其中#thumbs是添加的触发器,.resetPrice是带有工具提示的元素,添加以下代码: $('#thumbs').hover(

我试图通过将鼠标悬停在另一个元素上,触发一个引导工具提示出现在一个元素上。我在想,当我将鼠标悬停在我想要触发的元素上时,我可能可以使用JQuery将类添加到我想要显示工具提示的元素上,但这似乎不起作用,因为工具提示没有绑定到hoer伪类

我举了一个例子——在这个例子中,我希望工具提示显示在鼠标悬停在“刷新”按钮(可以工作)上,但也可以悬停在“竖起拇指”按钮上:

其中
#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>
游戏商店
还有应用商店