插件:SmoothScroll.js
CDN:https://cdnjs.com/libraries/smoothscroll
用法大概就下边这样了:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div {
height: 600px;
border: 1px solid black;
margin: 5px;
}
</style>
<script src="./js/SmoothScroll.js"></script>
</head>
<body>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<script>
SmoothScroll({
frameRate: 150,
animationTime: 1000,
stepSize: 100,
pulseAlgorithm: 1,
pulseScale: 4,
pulseNormalize: 1,
accelerationDelta: 50,
accelerationMax: 3,
keyboardSupport: 1,
arrowScroll: 50,
fixedBackground: 1
})
</script>
</body>
</html>
标签:插件,平滑,50,js,SmoothScroll,页面
From: https://www.cnblogs.com/duanyong/p/18678163