gpt4 book ai didi

javascript - 如何在单个网页中使用 introJs 设置两个介绍之旅?

转载 作者:行者123 更新时间:2023-12-02 07:33:46 26 4
gpt4 key购买 nike

我想使用 introJs 在一个网页中有两个单独的导览。但是在这样做的同时,一次旅行的数据步骤与另一次旅行重合。

最佳答案

设置不同的实例和步骤并将它们命名为 intro1 和 intro2(或您想要的任何其他名称)。

然后您可以将它们独立触发为 intro1.start() 和 intro2.start()

查看代码以设置以下步骤:

var intro1 = introJs();
intro1.setOptions({
tooltipPosition : 'top',
steps: [
{
element: '#intro1_step1',
intro: 'Welcome to your example.com dashboard, where you can update your skills, your availability, and your professional details so that ...',
position: 'top'
}, {
element: '#intro1_step2',
intro: 'Your profile contains important information which is important to complete so that...',
position: 'bottom'
},
{
element: '#intro1_step3',
intro: 'Make sure your attribute is included in your profile because the client may express a preference.',
position: 'top'
},
{
element: '#intro1_step4',
intro: 'Click here to add a photograph of yourself.',
position: 'top'
},
{
element: '#intro1_step5',
intro: 'Your photograph will appear when your profile matches a ...',
position: 'top'
},
{
element: '#intro1_step6',
intro: 'Take example.com with you, on your Android or Apple phone by clicking here.',
position: 'top'
}
]
});
var intro2 = introJs();
intro1.setOptions({
tooltipPosition : 'top',
steps: [
{
element: '#intro2_step1',
intro: 'Welcome to your example2.com dashboard, where...',
position: 'top'
}, {
element: '#intro2_step2',
intro: 'Your...',
position: 'bottom'
},
{
element: '#intro2_step3',
intro: 'Make sure...',
position: 'top'
},
{
element: '#intro2_step4',
intro: 'Click here to...',
position: 'top'
},
{
element: '#intro2_step5',
intro: 'In this step...',
position: 'top'
},
{
element: '#intro2_step6',
intro: 'Take example2.com with you, on your Android or Apple phone by clicking here.',
position: 'top'
}
]
});

美妙的是你不需要在 html 中嵌入那么多的元信息,只是

<p id="intro1_step1">Blah Blah Blah</p>

关于javascript - 如何在单个网页中使用 introJs 设置两个介绍之旅?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19111837/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com