ng-bootstrap - 向 ng-bootstrap 工具提示添加延迟

标签 ng-bootstrap

与 Bootstrap 工具提示相反,Angular 2 的 ng-bootstrap 工具提示位于 https://ng-bootstrap.github.io/#/components/tooltip没有延迟的规定,所以工具提示会立即弹出。

我在 https://github.com/ng-bootstrap/ng-bootstrap/issues/1052 看到一个关于这个“ngbTooltip:添加新选项“延迟”的问题但它被列为“无人分配”。

是否有一种解决方法可以应用于像 https://ng-bootstrap.github.io/app/components/tooltip/demos/basic/plnkr.html 这样的简单代码?添加延迟?

是否有某种方法可以评估是否可能将延迟容量添加到 ngbTooltip 中?

最佳答案

this comment 中所述,你可以用纯 css 来实现:

.tooltip > div {
  animation-name: delayedFadeIn;
  animation-duration: 1s; /* Adjust this duration */
}

@Keyframes delayedFadeIn {
  0% {opacity: 0;}
  75% {opacity: 0;} /* Set this to 99% for no fade-in. */
  100% {opacity: 1;}
}

如果你想让它成为可选的,你可以定义另一个类,例如 .delayed :
.delayed.tooltip > div {
  animation-name: delayedFadeIn;
  animation-duration: 1s; /* Adjust this duration */
}

@Keyframes delayedFadeIn {
  0% {opacity: 0;}
  75% {opacity: 0;} /* Set this to 99% for no fade-in. */
  100% {opacity: 1;}
}

关于ng-bootstrap - 向 ng-bootstrap 工具提示添加延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43477836/

相关文章:

angular - 使用 ng-bootstrap 编译 JavaScriptServices 项目时出现意外标记

css - 如何在 ng-bootstrap 中更改模态框的位置

css - 按钮垂直组,在 bootstrap 4 中对齐到底部

Angular 2 - ng-bootstrap 如何为他们的 NgbRadio 指令提供 NgbRadioGroup 和 NgbButtonLabel?

angular - NgbDatePicker - 如何将 longDate 字符串绑定(bind)到 [ngModel]?

angular - Bootstrap 不适用于 Angular 2

javascript - Angular NgbModal beforeDismiss 不起作用

angular - 如何将数据传递给 ng-bootstrap popover

ng-bootstrap - 如何更改 NgbCollapse 默认值 false?

css - Ng-bootstrap 'ngbPopover' 不是当父容器具有 'transform' css 属性时