-
Notifications
You must be signed in to change notification settings - Fork 1
/
arrow-test.html
68 lines (58 loc) · 1.6 KB
/
arrow-test.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
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
<!DOCTYPE html>
<html ng-app="">
<head>
<style>
#diagramContainer {
padding: 20px;
width:80%; height: 400px;
border: 1px solid gray;
}
.item {
height:80px; width: 80px;
border: 1px solid blue;
float: left;
position: absolute;
}
</style>
<script src="jquery-1.9.1.min.js"></script>
<script src="jquery-ui-1.9.2.min.js"></script>
<script src="jquery.jsPlumb-1.4.1-all-min.js"></script>
</head>
<body>
<div id="diagramContainer">
<div id="item_left" class="item"></div>
<div id="item_right" class="item" style="left:250px;"></div>
</div>
<script>
jsPlumb.ready(function() {
jsPlumb.draggable($(".item"), {});
var common = {
connector: ["Straight"],
endpoint:"Dot",
overlays:[
["Arrow" , { width:12, length:12, location:0.67 }]
]
};
jsPlumb.connect({
source:"item_left",
target:"item_right",
paintStyle:{ strokeStyle:"lightgray", lineWidth:3 },
endpointStyle:{ fillStyle:"lightgray", outlineColor:"gray" },
}, common);
jsPlumb.addEndpoint($(".item"), {
isSource: true,
anchor: ["Right"],
connector: {
overlays: [
["Arrow", {width: 12, length: 12, location: 0.67}]
]
}
});
jsPlumb.addEndpoint($(".item"), {
isTarget: true,
anchor: ["Left"]
});
});
</script>
</body>
</html>