【问题标题】:Why is IntroJS tooltipClass option not working为什么 IntroJS tooltipClass 选项不起作用
【发布时间】:2021-08-17 13:09:42
【问题描述】:

我在我的 Angular 应用程序中使用 introJS。我根据他们网站上的教程一步一步地进行。我想改变样式,所以我基本上复制了他们的代码,但它没有用。它添加了类,但对提示没有影响。

我的 TS:

this.introJS.setOptions({
      tooltipClass: 'customTooltip'
    }).start();

我的 Scss:

.customTooltip * {
  color: #e81717;
  font-size: 18px;
}

.customTooltip .introjs-tooltip-title {
  color: #0a41c9;
}

我的html:

<div class="card-demo" data-tooltipClass="customTooltip" data-title="Welcome!" data-intro="Hello World!">
</div>

【问题讨论】:

    标签: css sass intro.js


    【解决方案1】:

    问题是该类是在组件 scss 中创建的。但我需要创建一个全局 css 类并使用它。

    为什么?因为组件嵌套在 app-root 中,而 app-root 是 intro.js 元素的兄弟,但它们都在 index.html 中,所以当我创建全局 css 类时,intro.js 元素能够访问它。

    【讨论】:

      猜你喜欢
      • 2019-10-25
      • 1970-01-01
      • 2018-09-07
      • 2015-02-18
      • 2016-11-01
      • 2012-01-08
      • 2011-04-07
      • 1970-01-01
      • 2013-11-03
      相关资源
      最近更新 更多