source: Dev/trunk/d3/examples/hello-world/hello-transition.html @ 76

Last change on this file since 76 was 76, checked in by fpvanagthoven, 14 years ago

d3

File size: 868 bytes
Line 
1<!DOCTYPE html>
2<html>
3  <head>
4    <title>Hello, transition!</title>
5    <script type="text/javascript" src="../../d3.js"></script>
6    <style type="text/css">
7
8body {
9  font: 14px Helvetica Neue;
10  text-rendering: optimizeLegibility;
11  margin: 1em;
12}
13
14div {
15  font-size: 42px;
16  margin-top: .5em;
17  background-color: steelblue;
18  color: white;
19  text-align: right;
20}
21
22    </style>
23  </head>
24  <body>
25    Your lucky number is:<br>
26    <div></div>
27    <script type="text/javascript">
28
29transform();
30
31function transform() {
32  d3.select("div")
33      .style("width", "0%")
34      .style("background-color", "steelblue")
35      .text("hello\u00a0")
36    .transition()
37      .ease("bounce")
38      .duration(2000)
39      .style("width", "100%")
40      .style("background-color", "brown");
41}
42
43window.addEventListener("keypress", transform, false);
44
45    </script>
46  </body>
47</html>
Note: See TracBrowser for help on using the repository browser.