28 Video Speed Controller
筆記
作法:
1.取 DOM及滑鼠點擊邏輯1
2
3
4
5
6
7
8
9const video = document.querySelector('.flex');
const speed = document.querySelector('.speed');
const speedBar = document.querySelector('.speed-bar');
let isClick = false;
speed.addEventListener('mousemove',handleMove);
speed.addEventListener('mousedown',()=>isClick = true);
speed.addEventListener('mouseup',()=>isClick = false);
speed.addEventListener('mouseleave',()=>isClick = false);
})
2.監聽滑鼠移動
1 | if(isClick){ |