HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
var stage = acgraph.create("container");
2
3
stage.rect(0, stage.height() / 3, stage.width(), stage.height() / 3)
4
.fill("#FF6666")
5
.stroke("#FF6666");
6
7
for (var i = 1; i < 11; i = i + 3) {
8
var rect = stage.rect(
9
(stage.width() / 12) * (i - 1) + (stage.width() / 36),
10
stage.height() / 9,
11
stage.width() / 12,
12
stage.height() / 1);
13
var text = stage.text(
14
(stage.width() / 12) * (i - 1) + (stage.width() / 36),
15
stage.height() / 9,
16
''
17
);
18
if (i > 9) {
19
rect.fill("#b9b9b9").stroke("#bbb");
20
text.text("opacity: 1");
21
} else {
22
rect.fill("#b9b9b9 0." + i).stroke("#bbb");
23
text.text("opacity: 0." + (i));
24
}
25
}