Coder Social home page Coder Social logo

Comments (3)

MatteoAlberghini avatar MatteoAlberghini commented on August 23, 2024

Hi, I'm not the maintainer of the library, but I had a similar problem (I wanted the user to be able to scroll the images with touch and without scrolling)

I solved it this way:

  • In the SliderBox.js file, there is a onCurrentImagePressedHandler function, this is the on touch function (This is useful in my particular case and not yours, but I'm getting there)

  • The SliderBox class has a reference ( _ref ) to the Carousel Component

  • This component has 2 methods: snapToNext and snapToPrev, you can call them to move to next or previous image

  • I personally made it so if the user clicks the right side of the image it scrolls to the right, and vice versa for the left side

  • You could make your own function inside SliderBox.js and call it when the user clicks the button (just be sure to save the reference to the slider in your custom class), and solved it this way

If the maintainer is reading this comment, you can implement a custom forward or backwards scroll using this._ref.snapToNext() or this._ref.snapToPrev()

from react-native-image-slider-box.

mtebele avatar mtebele commented on August 23, 2024

Exactly, check out my fork, I've already implemented this: https://github.com/CodeaIT/react-native-image-slider-box

from react-native-image-slider-box.

punjasin avatar punjasin commented on August 23, 2024

@mtebele i try your fork but seem only dot is move image is doesn't

from react-native-image-slider-box.

Related Issues (20)

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.