JS: react-coverflow

less than 1 minute read

Today, I add react-coverflow in my website, this Multi-item carousel is very beautiful and easily to use;

gallery

Here is the code:

npm install react-coverflow

JS

import React from 'react';
var Coverflow = require('react-coverflow');

var fn = function () {
  /* do you want */
}

class Gallery extends React.Component {
  render() {
    return (
      <Coverflow
        // width={960}
        // height={480}
        // displayQuantityOfSide={2}
        // navigation={false}
        // enableHeading={true}
      >
        {/* <div
        onClick={() => fn()}
        onKeyDown={() => fn()}
        role="menuitem"
        tabIndex="0"
      >
      </div> */}
        <img src={require('../images/img1.jpg')} alt='title or description' data-action="http://andyyou.github.io/react-coverflow/" />
        <img src={require('../images/img2.jpg')} alt='title or description' data-action="http://andyyou.github.io/react-coverflow/" />
        <img src={require('../images/img3.jpg')} alt='title or description' data-action="http://andyyou.github.io/react-coverflow/" />
      </Coverflow>
    )
  }
}

export default Gallery;  

I didn’t find the properties of background, so I change background color in CSS

CSS:

.coverflow__container__1P-xE{
    background: #fafafa !important;
}