_Header.md
... ...
@@ -7,7 +7,6 @@
7 7
<p>
8 8
<a href="./"><button class="button_header button_home" style="float: left; margin: 0px 0px;" >Home</button></a>
9 9
<a href="/biblio_theorie.md"><button class="button_header button_theory" onclick="window.location.href='';" style="float: right;">Theory</button></a>
10
-
11 10
<button class="button_header button_militant" onclick="window.location.href='';" style="float: right;">Militantisme</button>
12 11
<button class="button_header button_history" onclick="window.location.href='';" style="float: right;">History</button>
13 12
</p>
biblio_theorie.md
... ...
@@ -80,9 +80,7 @@ Précisions sur les théories et les pensées qui inspirent et façonnent notre
80 80
81 81
<div id="container"><img ondragstart="return false" id="drag-img" src="media/images/mermaid-diagram-theorie.png" /></div>
82 82
83
-<input type="button" id="zoomout" class="button" value="Zoom out">
84
-
85
-<input type="button" id="zoomin" class="button" value="Zoom in">
83
+<input type="button" id="zoomout" class="button" value="Zoom out"><input type="button" id="zoomin" class="button" value="Zoom in">
86 84
87 85
88 86
<h2 style="text-align: left; Border-bottom: none;">Primitivismes, environnementalismes, écologismes</h2>
custom.js
... ...
@@ -4,45 +4,46 @@ x_cursor = 0,
4 4
y_cursor = 0,
5 5
x_img_ele = 0,
6 6
y_img_ele = 0;
7
-
8
-function zoom(zoomincrement) {
9
-img_ele = document.getElementById('drag-img');
10
-var pre_width = img_ele.getBoundingClientRect().width, pre_height = img_ele.getBoundingClientRect().height;
11
-img_ele.style.width = (pre_width * zoomincrement) + 'px';
12
-img_ele.style.height = (pre_height * zoomincrement) + 'px';
13
-img_ele = null;
14
-}
15
-
16
-document.getElementById('zoomout').addEventListener('click', function() {
17
-zoom(0.5);
18
-});
19
-document.getElementById('zoomin').addEventListener('click', function() {
20
-zoom(1.5);
21
-});
22
-
23
-function start_drag() {
24
-img_ele = this;
25
-x_img_ele = window.event.clientX - document.getElementById('drag-img').offsetLeft;
26
-y_img_ele = window.event.clientY - document.getElementById('drag-img').offsetTop;
27
-
28
-}
29
-
30
-function stop_drag() {
31
-img_ele = null;
32
-}
33
-
34
-function while_drag() {
35
-var x_cursor = window.event.clientX;
36
-var y_cursor = window.event.clientY;
37
-if (img_ele !== null) {
38
- img_ele.style.left = (x_cursor - x_img_ele) + 'px';
39
- img_ele.style.top = ( window.event.clientY - y_img_ele) + 'px';
40
-
41
- console.log(img_ele.style.left+' - '+img_ele.style.top);
42
-
43
-}
44
-}
45
-
46
-document.getElementById('drag-img').addEventListener('mousedown', start_drag);
47
-document.getElementById('container').addEventListener('mousemove', while_drag);
48
-document.getElementById('container').addEventListener('mouseup', stop_drag);
7
+$( document ).ready(
8
+ function zoom(zoomincrement) {
9
+ img_ele = document.getElementById('drag-img');
10
+ var pre_width = img_ele.getBoundingClientRect().width, pre_height = img_ele.getBoundingClientRect().height;
11
+ img_ele.style.width = (pre_width * zoomincrement) + 'px';
12
+ img_ele.style.height = (pre_height * zoomincrement) + 'px';
13
+ img_ele = null;
14
+ }
15
+
16
+ document.getElementById('zoomout').addEventListener('click', function() {
17
+ zoom(0.5);
18
+ });
19
+ document.getElementById('zoomin').addEventListener('click', function() {
20
+ zoom(1.5);
21
+ });
22
+
23
+ function start_drag() {
24
+ img_ele = this;
25
+ x_img_ele = window.event.clientX - document.getElementById('drag-img').offsetLeft;
26
+ y_img_ele = window.event.clientY - document.getElementById('drag-img').offsetTop;
27
+
28
+ }
29
+
30
+ function stop_drag() {
31
+ img_ele = null;
32
+ }
33
+
34
+ function while_drag() {
35
+ var x_cursor = window.event.clientX;
36
+ var y_cursor = window.event.clientY;
37
+ if (img_ele !== null) {
38
+ img_ele.style.left = (x_cursor - x_img_ele) + 'px';
39
+ img_ele.style.top = ( window.event.clientY - y_img_ele) + 'px';
40
+
41
+ console.log(img_ele.style.left+' - '+img_ele.style.top);
42
+
43
+ }
44
+ }
45
+
46
+ document.getElementById('drag-img').addEventListener('mousedown', start_drag);
47
+ document.getElementById('container').addEventListener('mousemove', while_drag);
48
+ document.getElementById('container').addEventListener('mouseup', stop_drag);
49
+);
... ...
\ No newline at end of file