Giter Site home page Giter Site logo

Comments (3)

DZuz14 avatar DZuz14 commented on July 30, 2024

I can look into this for you. Sorry, I wish Github emailed me when this was first created, I had no idea you posted something. I will try to turn on notifications.

from react-hooks-image-slider.

mgmgpyaesonewin avatar mgmgpyaesonewin commented on July 30, 2024
  componentDidMount() {
    this.interval = setInterval(() => this.nextSlide(), 3000)
  }

  componentWillUnmount() {
    clearInterval(this.interval)
  }

I just want to wonder if I want to play these sliders automatically, will it be the right way to make it?

from react-hooks-image-slider.

DZuz14 avatar DZuz14 commented on July 30, 2024

You are on the right track. I did something similar to what you wanted to do with a setInterval function. You can check out the working example by clicking enable autoplay in the working demo here https://react-slider.herokuapp.com/

In the code, you can find the logic for this inside the "componentDidUpdate" method inside of the "Slider" component.

from react-hooks-image-slider.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.