dzuz14 / react-hooks-image-slider Goto Github PK
View Code? Open in Web Editor NEWImage Slider built with React Hooks.
Home Page: https://dzuz14.github.io/react-hooks-image-slider/
Image Slider built with React Hooks.
Home Page: https://dzuz14.github.io/react-hooks-image-slider/
My opinion, if click on the next button (autoplay on), it should restart the interval. WDYT?
My initial idea is to let the parent component that contains the Slider control whether autoplay is active. That would require setting autoPlay to a state variable. You'd end up passing the autoPlay variable, and a function to stop autoplay down to the Slider as props. The nextSlide and prevSlide functions would then need to have additional logic added to handle stopping the autoplay by executing the function passed down as props.
Perhaps instead, you could display some type of icon that would allow the user to toggle autoplay by clicking on it. We wouldn't attach that functionality to the arrows at all, removing the necessity of refactoring are prevSlide and nextSlide function.
Let me know what your ideas are.
Hello, I found a issue when I resize the window or container of slide.
The scenarie is:
When used as child components, the slider overlaps.That is overflows What should i do?
I tried out adding an animation on transform translateX but facing issue like images not rendering to view. Can anyone have idea to add a animation on previous and next.
When trying to use two (or more) sliders at the same time, the last one works properly but any other one transitions back and forth to active slide when arrows are clicked. I don't know why but smoothTransition
is called twice so it transitions, then the slides are updated and then it transitions again.
Any clue on why is this happening?
whoops. need to pass autoplay via redux prop in settings
I am thinking that we might want to use real <img />
elements instead of a div that sets the images as a background.
For example:
Let's say you want 3 images per slide, you could then use the srcset attribute to show different sized images dependent on the width of the browser. This would require the developer(s) to create multiple copies of their images at different sizes prior to utilizing the Slider properly.
I think at least at first glance this is a decent idea, as it accounts for performance and won't load large image files on smaller devices.
good work though
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.