Skip to content

Commit 886dbb4

Browse files
committed
fixbug
1 parent 964d33a commit 886dbb4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

02-Archery-Game/script.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@ function draw(e) {
7171
aim(e);
7272
}
7373

74-
74+
// 禁止下拉刷新
75+
document.addEventListener('touchmove', function(event) {
76+
event.preventDefault(); // 阻止默认行为
77+
}, { passive: false });
7578

7679
function aim(e) {
77-
e.preventDefault();
78-
80+
7981
// get mouse position in relation to svg position and scale
8082
var point = getMouseSVG(e);
8183
point.x = Math.min(point.x, pivot.x - 7);

0 commit comments

Comments
 (0)