虽然
数据位置="左"
确实有效,我发现在 HTML 中嵌入所有元信息会让人更难理解正在发生的事情,而且也会让在工具提示中嵌入更多“冒险”的代码,比如视频播放,真的很难看,很难理解。
如果您设置选项步骤,您将更容易理解和管理代码,您甚至可以在同一页面上拥有多个 intro.js 序列。
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'
}
]
});
只需使用 intro1.start() 和 intro2.start() 即可启动您需要的序列