-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
52 lines (46 loc) · 966 Bytes
/
Copy pathtest.html
File metadata and controls
52 lines (46 loc) · 966 Bytes
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
<html>
<head>
<style>
#board
{
width:530px;
height:530px;
background:#8e8e88;
//cursor: url('BlackKnight.png'), auto;
}
img
{
position:absolute;
}
</style>
<script type="text/javascript">
var pieceSelected = false;
function moveImg( e )
{
e.style.display = 'none';
document.body.style.cursor = 'url(ChessPieces.png), auto';
pieceSelected = e;
}
function placeImg( )
{
if( pieceSelected == false )
{
return;
}
pieceSelected.style.top = event.clientY - 16;
pieceSelected.style.left = event.clientX - 16;
pieceSelected.style.display = 'inline';
document.body.style.cursor = 'default';
pieceSelected = false;
}
</script>
</head>
<body>
<div id="board" onmouseup="placeImg( );"></div>
<img style="display:inline;
top:128px;
left:128px;"
onmousedown="moveImg( this );"
src="BlackKnight.png"/>
</body>
</html>