我取得了什么:
// Get the id of the <path> element and the length of <path>
var myline = document.getElementById("myline");
var length = myline.getTotalLength();
circle = document.getElementById("circle");
// The start position of the drawing
myline.style.strokeDasharray = length;
// Hide the triangle by offsetting dash. Remove this line to show the triangle before scroll draw
myline.style.strokeDashoffset = length;
// Find scroll percentage on scroll (using cross-browser properties), and offset dash same amount as percentage scrolled
window.addEventListener("scroll", myFunction);
function myFunction() {
// What % …Run Code Online (Sandbox Code Playgroud)该网站仅提到缓和选项:
# easing: Name of the easing equation.
Run Code Online (Sandbox Code Playgroud)
但没有例子.
如何使用此功能?