-
Notifications
You must be signed in to change notification settings - Fork 0
/
one.html
32 lines (26 loc) · 819 Bytes
/
one.html
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
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<script>
function setmeup() {
var root = document.getElementById("nodeContainer");
var nodeObj = document.createElement("object");
nodeObj.type = "image/svg+xml";
nodeObj.data = "node.svg";
var newNode;
var x;
for( var i=0; i<11; i++)
{
x = i < 5 ? 50*i : 50*(10-i);
newNode = nodeObj.cloneNode(false);
newNode.setAttribute("style","position: absolute;left:" + x + "px; top:" + (i*60) + "px;" );
root.appendChild( newNode );
}
}
</script>
</head>
<body onload="setmeup()">
<div id="nodeContainer" style="position: absolute;height: 500px;" ></div>
</body>
</html>