【问题标题】:ng2-tooltip-directive hide tooltip on mousemove eventng2-tooltip-directive 在 mousemove 事件上隐藏工具提示
【发布时间】:2021-03-05 19:59:19
【问题描述】:

我想隐藏 mouseenter 事件的工具提示。我怎样才能做到这一点?

<div
  (mousemove)="closeTooltip()"

  [tooltip]="TooltipComponent" 
  content-type="template"  
  show-delay="500" 
  placement="right"  
  theme="light"
>


<ng-template #TooltipComponent>
  <app-tooltip-wrapper [data]="currentData"></app-tooltip-wrapper>
</ng-template>

【问题讨论】:

  • 也许我误解了,但看起来您正试图同时显示和隐藏工具提示。使用 tooltip 指令将鼠标悬停在 div 上将显示工具提示。同时 mousemove 事件将关闭工具提示。所以工具提示永远不会显示

标签: javascript angular ng2-tooltip-directive


【解决方案1】:

有一个设置点击后隐藏延迟的选项,默认值为2000,您可以将其设置为低于“300”毫秒,它会在点击时隐藏。

]hideDelayAfterClick]="'300'"

click here to view ng-tooltip doc

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多