-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
executable file
·42 lines (41 loc) · 913 Bytes
/
test.php
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>无标题文档</title>
<style>
body{cursor:pointer;}
#to_top{
width:7px; height:7px;
background-color:red;
position:absolute;
transform: rotate(45deg);
}
</style>
<script>
window.onload = function(){
var oTop = document.getElementById("to_top");
document.onmousemove = function(evt){
var oEvent = evt || window.event;
var scrollleft = document.documentElement.scrollLeft || document.body.scrollLeft;
var scrolltop = document.documentElement.scrollTop || document.body.scrollTop;
setTimeout(function(){
//
oTop.style.left = oEvent.clientX + scrollleft +"px";
oTop.style.top = oEvent.clientY + scrolltop + "px";
//
}, 500);
}
}
</script>
<style>
#to_top{
width:7px; height:7px;
background-color:red;
position:absolute;
transform: rotate(45deg);
}
</style>
<div id="to_top"></div>
</body>
</html>