【发布时间】:2019-06-26 03:19:04
【问题描述】:
我在 Angular 7 中使用 introJS。我有以下设置选项:
introJS = introJs();
this.introJS.setOptions({
tooltipPosition: 'auto',
positionPrecedence: ['left', 'right', 'top', 'bottom'],
showBullets: true,
showStepNumbers:true,
steps: [
{
element: '#step1',
intro: "This is step1."
},
{
element: '#step2',
intro: "This is step 2, but is hidden in DOM."
},
{
element: '#step3',
intro: "This is step3, but it does not exist in DOM."
},
{
element: '#step4',
intro: "This is step 4",
}
]
});
this.introJS.start();
此步骤选项是静态的,并且这些步骤可能隐藏或不存在于 DOM 中。在这种情况下,如果具有该 ID 的 DOM 元素不可见或在 DOM 中不存在,我希望游览忽略这些步骤并继续前进。
为此,我遇到了 JQuery alternative,但不知道如何针对 Angular 进行调整。
【问题讨论】: