网站引导功能实现

欢迎加入前端交流群交流知识获取视频资料:749539640

背景:发布了新网站,需要引导用户操作或者发布了新功能需要展示给用户

实现:借助driver.js 第三方类库实现

demo:样式如下图

 实现方式:点击查看示例代码

 api介绍:

 1 const driver = new Driver({
 2   className: 'scoped-class',        // 放入你自定义的className
 3   animate: true,                    // 是否使用动画,默认true
 4   opacity: 0.75,                    // 背景透明度(0表示仅弹出且不覆盖)
 5   padding: 10,                      // Distance of element from around the edges
 6   allowClose: true,                 // Whether the click on overlay should close or not
 7   overlayClickNext: false,          // Whether the click on overlay should move next
 8   doneBtnText: 'Done',              // 结束按钮文字
 9   closeBtnText: 'Close',            // 关闭按钮文字
10   stageBackground: '#ffffff',       // Background color for the staged behind highlighted element
11   nextBtnText: 'Next',              // 下一步文字
12   prevBtnText: 'Previous',          // 上一步文字
13   showButtons: false,               // Do not show control buttons in footer
14   keyboardControl: true,            // Allow controlling through keyboard (escape to close, arrow keys to move)
15   scrollIntoViewOptions: {},        // We use `scrollIntoView()` when possible, pass here the options for it if you want any
16   onHighlightStarted: (Element) => {}, // Called when element is about to be highlighted
17   onHighlighted: (Element) => {},      // Called when element is fully highlighted
18   onDeselected: (Element) => {},       // Called when element has been deselected
19   onReset: (Element) => {},            // Called when overlay is about to be cleared
20   onNext: (Element) => {},                    // Called when moving to next step on any step
21   onPrevious: (Element) => {},                // Called when moving to previous step on any step
22 });

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WangZCII

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值