-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (43 loc) · 1.25 KB
/
Copy pathindex.html
File metadata and controls
47 lines (43 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mouse Position Logger (Developer Rayhan)</title>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<style>
#textarea {
width: 28%;
height: 300px;
overflow-y: auto;
background: #f9f9f9;
border: 1px solid #ccc;
padding: 10px;
font-family: monospace;
white-space: pre-wrap;
}
@media screen and (max-width: 600px) {
#textarea {
width: 50%;
}
}
@media screen and (max-width: 324px) {
#textarea {
width: 28%;
}
}
</style>
</head>
<body>
<div id="textarea"></div>
<script>
$(document).mousemove(function (e) {
let top = e.pageY;
let left = e.pageX;
let newLog = `<span style="color: blue;">Left: ${left}</span> <span style="color: green;">Top: ${top}</span><br>`;
$("#textarea").append(newLog);
$("#textarea").scrollTop($("#textarea")[0].scrollHeight);
});
</script>
</body>
</html>