Created
December 1, 2017 20:02
-
-
Save biyootiful/a20a8be47d936a641d3355761bda2021 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slideLeft(index) { | |
const { catWidth } = this.state; | |
let slideTo = 0; | |
for (let i = 0; i < index; i++) { | |
slideTo += catWidth[i] + 40; | |
} | |
this.setState({ | |
toLeft: slideTo * -1 + 40, | |
currentSlideIndex: index, | |
currentItem: 0 | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment