Skip to content

Commit

Permalink
滑块添加随机元素
Browse files Browse the repository at this point in the history
  • Loading branch information
poll committed Jan 11, 2023
1 parent 0a481f8 commit 244b127
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 244b127

Please sign in to comment.