-
Notifications
You must be signed in to change notification settings - Fork 2
/
raphaelTest.html
42 lines (37 loc) · 1.13 KB
/
raphaelTest.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
<!DOCTYPE html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>Raphael Dev testing html</title>
<style>
#container {
overflow: hidden;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="raphael.min.js"></script>
<script src="raphael.draggable.js"></script>
<script type="text/javascript">
window.onload = function () {
var paper = Raphael("container", 640, 720);
var circle = paper.circle(100, 100, 100).attr({ 'fill': '270-#FAE56B:0-#E56B6B:100' });
var text = paper.text(400, 50, "我是被绘制出来的图片")
text.attr({
"font-size": "30px"
});
paper.zoomEnable()
//画布背景整体拖动
paper.draggable()
text.click(function () {
//画布背景还原初始位置
paper.reset()
})
//单独元素拖动
circle.draggable()
text.draggable()
};
</script>
</body>
</html>