forked from bluemarvin/html
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrid.html
More file actions
157 lines (125 loc) · 2.44 KB
/
Copy pathgrid.html
File metadata and controls
157 lines (125 loc) · 2.44 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<html>
<head>
<script src="scripts/jquery-1.7.2.min.js"></script>
<script>
(function () {
function placement() {
$(".box").each(function () {
var offset = $(this).offset();
this.innerHTML = offset.left.toString() + ", " + offset.top.toString();
});
}
$(document).ready(function () {
var position = $("#position")
, target = $("#target")
, offsetX = 32
, offsetY = 32
;
placement();
if (!position || !target) { return; }
function click (event) {
offsetY = target.height() / 2;
offsetX = target.width() / 2;
position.html(event.pageX.toString() + ", " + event.pageY.toString());
target.css({"top": event.pageY - offsetY, "left": event.pageX - offsetX});
return false;
}
$(document).click(click);
$(document).dblclick(click);
});
$(window).resize(function () {
placement();
});
})();
</script>
<style type="text/css">
body {
background-color: white;
}
#position {
background-color: white;
position: fixed;
top: 5px;
}
#target {
position: absolute;
top: 20px;
left: 30px;
}
.container {
width: 1200px;
height: 2200px;
margin: 0 auto;
}
.row {
width: 600px;
clear: left;
}
.box {
float: left;
width: 180px;
height: 180px;
background-color: black;
margin-right: 10px;
margin-left: 10px;
margin-top: 10px;
margin-bottom: 10px;
}
.red {
background-color: red;
}
.orange {
background-color: orange;
}
.yellow {
background-color: yellow;
}
.green {
background-color: green;
}
.blue {
background-color: blue;
}
.indigo {
background-color: indigo;
}
.purple {
background-color: purple;
}
.violet {
background-color: violet;
}
</style>
</head>
<body>
<div id="position">None</div>
<div class="container">
<div class="row">
<div class="box red"></div>
<div class="box orange"></div>
<div class="box yellow"></div>
</div>
<div class="row">
<div class="box orange"></div>
<div class="box yellow"></div>
<div class="box green"></div>
</div>
<div class="row">
<div class="box yellow"></div>
<div class="box green"></div>
<div class="box blue"></div>
</div>
<div class="row">
<div class="box green"></div>
<div class="box blue"></div>
<div class="box indigo"></div>
</div>
<div class="row">
<div class="box blue"></div>
<div class="box indigo"></div>
<div class="box red"></div>
</div>
<div id="target"><img src="images/x.png"></div>
</div>
</body>
</html>