-
Notifications
You must be signed in to change notification settings - Fork 2
/
template10.html
130 lines (112 loc) · 3.39 KB
/
template10.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="js/jquery.js"></script>
<link href="style/default.min.css" rel="stylesheet">
<link rel="stylesheet" href="style/style.css">
<script src="js/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="js/initTemp.js"></script>
<style>
#tip{
float: right;
font-size: 12px;
margin-right:20px;
overflow-y:scroll;
height: 200px;
}
</style>
</head>
<body>
<div class="qcanvas_lay">
<canvas id="qcanvas"></canvas>
<span id="tip">
</span>
</div>
<div class="code_lay">
<pre><code class="js">var qcanvas = new Qcanvas(["qcanvas",300,200]);
var tip = document.getElementById('tip');
var rect1 = qcanvas.qrect.rect({
start:[20,20],
borderColor:'red',
fillColor:'green',
drag:false,
mouseout:function(){
console.log('绿色块mouseout事件');
tip.innerHTML ='绿色块mouseout事件'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
},
mouseenter:function(){
console.log('绿色块mouseenter事件');
tip.innerHTML ='绿色块mouseenter事件'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
}
})
var rect = qcanvas.qrect.rect({
start:[0,10],
borderColor:'red',
fillColor:'blue',
drag:false,
mouseup:function(){
console.log('蓝色块mouseup事件');
tip.innerHTML ='蓝色块mouseup事件'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
},
mousedown:function(){
console.log('蓝色块mousedown事件');
tip.innerHTML ='蓝色块mousedown事件'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
},
mousemove:function(){
console.log('蓝色块mousemove事件');
tip.innerHTML ='蓝色块mousemove事件'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
},
mouseout:function(){
console.log('蓝色块mouseout事件');
tip.innerHTML ='蓝色块mouseout事件'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
}
})
</code>
</pre>
</div>
</body>
<script src='Qcanvas.js'></script>
<script>
var qcanvas = new Qcanvas(["qcanvas",300,200]);
var tip = document.getElementById('tip');
var rect1 = qcanvas.qrect.rect({
start:[20,20],
borderColor:'red',
fillColor:'green',
drag:false,
mouseout:function(){
console.log('绿色块mouseout事件');
tip.innerHTML ='<font color="green">绿色块mouseout事件</font>'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
},
mouseenter:function(){
console.log('绿色块mouseenter事件');
tip.innerHTML ='<font color="green">绿色块mouseenter事件</font>'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
}
})
var rect = qcanvas.qrect.rect({
start:[0,10],
borderColor:'red',
fillColor:'blue',
drag:false,
mouseup:function(){
console.log('蓝色块mouseup事件');
tip.innerHTML ='<font color="blue">蓝色块mouseup事件</font>'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
},
mousedown:function(){
console.log('蓝色块mousedown事件');
tip.innerHTML ='<font color="blue">蓝色块mousedown事件</font>'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
},
mousemove:function(){
console.log('蓝色块mousemove事件');
tip.innerHTML ='<font color="blue">蓝色块mousemove事件</font>'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
},
mouseout:function(){
console.log('蓝色块mouseout事件');
tip.innerHTML ='<font color="blue">蓝色块mouseout事件</font>'+parseInt(Math.random()*10)+'<br>'+tip.innerHTML;
}
})
</script>
</html>