简体   繁体   English

将鼠标悬停在带有uib-tab的选项卡上时显示工具提示吗?

[英]Displaying a tooltip when hovering over a tab with uib-tab?

I'm having an HTML/Bootstrap issue. 我遇到了HTML / Bootstrap问题。 I have a group of tabs that I display using the uib-tabset directive on Angular Bootstrap (UI Bootstrap). 我在Angular Bootstrap(UI Bootstrap)上使用uib-tabset指令显示了一组选项卡。 I want to display a tooltip that displays when hovering over the tab if the tab is disabled. 我想显示一个工具提示,如果该选项卡被禁用,则将鼠标悬停在该选项卡上时会显示。 Anyone have an idea how to do this? 有人知道如何执行此操作吗? Here is the HTML (I'm not really sure what else to put, it's pretty simple): 这是HTML(我不太确定要放什么,这很简单):

<uib-tab disable="isBracketdisabled">
    <uib-tab-heading>
      I AM A HEADING
    </uib-tab-heading> 
</uib-tab>

If anyone could help I'd be very thankful. 如果有人可以帮助我,我将非常感激。 Thanks! 谢谢!

Simply apply the uib-tooltip directive to your tab using the tooltip-enable option to only display the tooltip when your condition is met: 只需使用tooltip-enable选项将uib-tooltip指令应用于选项卡,即可仅在满足条件时显示工具提示:

<uib-tab uib-tooltip="text" tooltip-enable="isBracketdisabled" 
    tooltip-class="customClass" disable="isBracketdisabled">

In regards to your comment, you can apply custom styling by using the tooltip-class attribute and passing in a custom class. 关于您的评论,您可以通过使用tooltip-class属性并传入自定义类来应用自定义样式。 You can then style it to your liking in your css: 然后,您可以根据自己的CSS样式来设置样式:

.tooltip.customClass {
    z-index: 1000
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM