Update index.html

'current' makes more sense than 'start' as the value increments passed it's start value.
This commit is contained in:
Tony Spiro 2015-03-27 15:17:07 -05:00
parent e30dd83896
commit 03e0ebf532
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@
var AnimateDemo = React.createClass({
getInitialState: function() {
return {start: 0};
return {current: 0};
},
componentDidMount: function() {
@ -47,14 +47,14 @@
},
tick: function() {
this.setState({start: this.state.start + 1});
this.setState({current: this.state.current + 1});
},
render: function() {
var children = [];
var pos = 0;
var colors = ['red', 'gray', 'blue'];
for (var i = this.state.start; i < this.state.start + 3; i++) {
for (var i = this.state.current; i < this.state.current + 3; i++) {
var style = {
left: pos * 128,
background: colors[i % 3]