-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
53 lines (41 loc) · 1.31 KB
/
script.js
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
function zoomPlus()
{
let svgElement = document.getElementById("svg_image");
svgElement.currentScale += 0.1;
svgElement.currentTranslate.x -= 20;
svgElement.currentTranslate.y -= 20;
svgElement.style.width = parseInt(svgElement.style.width) + 10 + 'px';
svgElement.style.height = parseInt(svgElement.style.height) + 10 + 'px';
}
function zoomMoins()
{
let svgElement = document.getElementById("svg_image");
svgElement.currentScale -= 0.1;
svgElement.currentTranslate.x += 20;
svgElement.currentTranslate.y += 20;
svgElement.style.width = parseInt(svgElement.style.width) - 10 + 'px';
svgElement.style.height = parseInt(svgElement.style.height) - 10 + 'px';
}
function show(id)
{
let element = document.getElementById(id);
if(element != undefined)
{
element.style.display = 'block';
}
}
function hide(id)
{
let element = document.getElementById(id);
if(element != undefined)
{
element.style.display = 'none';
}
}
document.getElementById("zoomplus").addEventListener('click', zoomPlus);
document.getElementById("zoommoins").addEventListener('click', zoomMoins);
/*let domaine = document.getElementById("form_domaine");
domaine.style.height = window.innerHeight + 'px';
alert(window.innerHeight);
domaine.style.overflow = 'auto';
*/