Skip to content

Commit

Permalink
Merge pull request #71 from thriller-ab/main
Browse files Browse the repository at this point in the history
滑块添加随机元素
  • Loading branch information
thriller-ab authored Jan 11, 2023
2 parents dfb0c5e + 244b127 commit 5b9bb72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 不学习何以强国.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ function dragandDrop(btn_hk, clientX, clientY, distance) {
k = 0,
interval;
iME(elem,"mousedown",0, 0, clientX, clientY);
let waitTime = Math.floor(Math.random() * (0.5 * 1000 - 0.1 * 1000) + 0.1 * 1000)
interval = setInterval(function() {
k++;
iter(k);
if (k === distance) {
clearInterval(interval);
iME(elem,"mouseup",clientX + k, clientY, 220 + k, 400);
}
}, 10);
}, waitTime);
function iter(y) {
iME(elem,"mousemove",clientX + y, clientY, clientX + y, clientY);
}
Expand Down

0 comments on commit 5b9bb72

Please sign in to comment.