Skip to content
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.

Commit

Permalink
make Carousel animation webkit compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentD committed Sep 22, 2016
1 parent c0b317b commit 80f6131
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ class Carousel extends Component {
const x = (indexs.indexOf(index) - 2) * elWidth;
return <div key={index} className={childrenClassName} style={{
transform: `translate3d(${x}px, 0, 0)`,
WebkitTransform: `translate3d(${x}px, 0, 0)`,
transition: (x === -(2 * elWidth) || x === (size + 1) * elWidth) ? 'none' : `transform ${speed}ms`,
WebkitTransition: (x === -(2 * elWidth) || x === (size + 1) * elWidth) ? 'none' : `transform ${speed}ms`,
willChange: "transform",
opacity: (x === -(2 * elWidth) || x === (size + 1) * elWidth) ? 0 : 1,
}}>{children[index]}</div>;
Expand Down

0 comments on commit 80f6131

Please sign in to comment.