forked from BasicPrimitives/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaseZoomWithCSSScaleTransform.html
More file actions
69 lines (61 loc) · 1.9 KB
/
Copy pathCaseZoomWithCSSScaleTransform.html
File metadata and controls
69 lines (61 loc) · 1.9 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zoom using CSS Scale Transform</title>
<script type="text/javascript" src="../../primitives.js"></script>
<link href="../../css/primitives.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var control;
document.addEventListener('DOMContentLoaded', function () {
var options = new primitives.OrgConfig();
var items = [
new primitives.OrgItemConfig({
id: 0,
parent: null,
title: "Title 0",
description: "Description",
image: "../images/photos/a.png"
})
];
var id = 1;
for (var index = 0; index < 2; index++) {
items.push(new primitives.OrgItemConfig({
id: ++id,
parent: 0,
title: id.toString() + " Title",
description: id.toString() + " Description",
image: "../images/photos/c.png"
}));
var parent = id;
for (var index2 = 0; index2 < 2; index2++) {
items.push(new primitives.OrgItemConfig({
id: ++id,
parent: parent,
title: id.toString() + " Title",
description: id.toString() + " Description",
image: "../images/photos/c.png"
}));
}
}
options.pageFitMode = primitives.PageFitMode.None;
options.items = items;
options.cursorItem = 0;
options.hasSelectorCheckbox = primitives.Enabled.True;
control = primitives.OrgDiagram(document.getElementById("basicdiagram"), options);
});
function onScale(scale) {
if (scale != null) {
control.setOption("scale", scale);
}
control.update(primitives.UpdateMode.Refresh);
}
</script>
</head>
<body>
<button onclick="onScale(0.5)">50%</button>
<button onclick="onScale(1)">100%</button>
<button onclick="onScale(1.5)">150%</button>
<div id="basicdiagram" style="width: 640px; height: 480px; overflow: hidden; border-style: dotted; border-width: 1px;"></div>
</body>
</html>