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

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

d3

File size: 809 bytes
Line 
1<!DOCTYPE html>
2<html>
3  <head>
4    <title>Hello, transition undefined!</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  text-align: right;
18}
19
20    </style>
21  </head>
22  <body>
23    Your lucky number is:<br>
24    <div>hello</div>
25    <script type="text/javascript">
26
27transform();
28
29function transform() {
30  d3.select("div")
31      .style("width", "0%")
32    .transition()
33      .ease("bounce")
34      .duration(2000)
35      .style("width", "100%")
36      .style("background-color", function() { return d3.hsl(180, Math.random(), .5); });
37}
38
39window.addEventListener("keypress", transform, false);
40
41    </script>
42  </body>
43</html>
Note: See TracBrowser for help on using the repository browser.