当前位置:网站首页>smoothscroll-polyfill插件的用法
smoothscroll-polyfill插件的用法
2022-07-26 19:29:00 【YingUser】
使用这个插件可以实现滑动的效果,具体步骤如下:
1、npm 下载
npm install smoothscroll-polyfill --save2、在main.js中全局引入
import smoothscroll from "smoothscroll-polyfill"
smoothscroll.polyfill();3、在当前页面使用就引入
import smoothscroll from 'smoothscroll-polyfill';
具体主代码如下:
//注释:这里的 order-lock 是需要跳到的那个标签的类名
this.timer = setTimeout(() => {
smoothscroll.polyfill();
document
.getElementsByClassName('order-lock')[0]
.scrollIntoView({ block: 'start', inline: 'center', behavior: 'smooth' });
}, 3000);边栏推荐
- C asynchronous programming read this article is enough
- Definition and use of one-dimensional array
- BluePrism流程业务对象的组件功能介绍-RPA第三章
- Exchange 2010 SSL证书安装文档
- How to wait for the return results of multiple asynchronous tasks synchronously?
- 京东荣获中国智能科学技术最高奖!盘点京东体系智能技术
- 密室逃脱、剧本杀加强监管 重点加强消防安全和未成年人保护
- 以 NFT 为抵押品的借贷协议模式探讨
- SQL优化的一些建议,希望可以帮到和我一样被SQL折磨的你
- 金融机构导图
猜你喜欢

会议OA之会议排座&送审

Fasttunnel open source intranet penetration framework

DevOps 实践多年,最痛的居然是?

Exchange 2010 SSL证书安装文档

Vite 配置 Eslint 规范代码

three.js 给地球加标签和弹窗
![[Android] the black technology behind kotlin's rapid compilation. Learn about it~](/img/d6/ae107f75c158e97913e6d75eac5b84.png)
[Android] the black technology behind kotlin's rapid compilation. Learn about it~

网红辣条抓不住年轻人

记一次 .NET 某物管后台服务 卡死分析

An open source web drawing board is really convenient
随机推荐
Strengthen supervision on secret room escape and script killing, and focus on strengthening fire safety and juvenile protection
【JVM 系列】JVM 调优
URL format
Student‘s t分布
There is an Oolong incident in open source. Maybe you don't know these five open source protocols
高瓴加入的PRI,君联、华控、盛世、绿动等百家机构都杀进去了
7岁男童因下棋太快?机器人竟夹断其手指
【ffmpeg】给视频文件添加时间戳 汇总
cv2.resize()
数据库笔记(来自老社)
Servlet
Using questpdf operation to generate PDF is faster and more efficient!
Exchange 2010 SSL certificate installation document
计算机网络常见面试题目总结,含答案
SQL优化的一些建议,希望可以帮到和我一样被SQL折磨的你
go+mysql+redis+vue3简单聊室,第6弹:使用vue3和element-plus调用接口
[cache series] advantages, disadvantages and choices of several cache read-write schemes
C # convert PDF files into pictures
An open source web drawing board is really convenient
Zabbix调用api检索方法