forked from Sebb767/HoverDotJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
128 lines (104 loc) · 3.69 KB
/
Copy pathdemo.html
File metadata and controls
128 lines (104 loc) · 3.69 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>hoverDotJS Demo</title>
<script src="jquery.js"></script>
<script src="hoverDot.js"></script>
<!-- jQuery UI is only for the resizeable demo and usually not required -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<style>
body {
padding-bottom: 50px;
padding-left: 25%;
padding-right: 25%;
}
.container {
width: 100%;
text-align: center;
}
.resize-container {
min-height: 1000px;
margin: 40px;
}
.map-container {
margin: 0;
padding: 0;
text-align: center;
}
.map-container canvas {
width: 100%;
height: auto;
padding-bottom: 135.535307517084%;
}
p {
font-size: 1.2em;
}
</style>
</head>
<body>
<div class="container">
<h1>HoverDotJS Demo</h1>
<p>This simple demo just has some dots on it. Feel free to hover them ;)</p>
<div class="map-container">
<canvas id="hoverdemo"></canvas>
</div>
<p>This is a demo where you can place dots. Just click anywhere.</p>
<div class="map-container">
<canvas id="hoverdemo-place" width="439px" height="595px"></canvas>
</div>
<p>This is a resizeable demo. Just resize the div!</p>
<div class="resize-container">
<div class="map-container">
<canvas id="hoverdemo-resize" width="439px" height="595px" class="ui-widget-content"></canvas>
</div>
</div>
<p>This is resizeable, too, but it will keep a 0.73781512605042 ratio and allows dot placement.</p>
<div class="resize-container">
<div class="map-container">
<canvas id="hoverdemo-resize-fw" width="439px" height="595px" class="ui-widget-content"></canvas>
</div>
</div>
<p>Thats all there is! Have a look at the page source or grab the code over at <a href="https://github.com/Sebb767/HoverDotJS">GitHub</a>!</p>
</div>
<script>
// its as simple as calling this function on a canvas!
$(window).load(function () {
// this is just showing some dots
$("#hoverdemo").dotHover([
{ x: 120 , y: 80, text: 'Example dot' },
{ x: 75000, y: 6700, text: 'I\'m a dot!' },
{ x: 12000, y: 18000, text: 'Hey there :)' }
], {
img: 'karte.png'
});
$("#hoverdemo-place").dotHover([], {
img: 'karte.png',
setmode: true
});
// same as below, but resizeable
var rz = $("#hoverdemo-resize");
rz.resizable();
rz.dotHover([
{ x: 28100, y: 48500, text: 'Example dot' },
{ x: 75000, y: 6700, text: 'I\'m a dot!' },
{ x: 12000, y: 18000, text: 'Hey there :)' }
], {
img: 'karte.png'
});
var rzf = $("#hoverdemo-resize-fw");
rzf.resizable();
rzf.dotHover([
{ x: 28100, y: 48500, text: 'Example dot' },
{ x: 75000, y: 6700, text: 'I\'m a dot!' },
{ x: 12000, y: 18000, text: 'Hey there :)' }
], {
img: 'karte.png',
setmode: true,
forceRatio: 0.73781512605042
});
});
</script>
</body>
</html>