Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop slider when infinite: false, React-Slick Slide #2394

Open
suyesnet opened this issue Aug 30, 2024 · 0 comments
Open

Stop slider when infinite: false, React-Slick Slide #2394

suyesnet opened this issue Aug 30, 2024 · 0 comments

Comments

@suyesnet
Copy link

working on a nextjs page.

using react-slick to slide name, categories etc.

when i click next button it still going backward, doesnt stop and creating space. (reference attached image)
This should be stop, when infinite is set to: false.

Inspired from this site to achieve this slider.

Screenshot at Aug 30 19-46-48

my setting. please check setup on Stackblitz

const CategoryScroller = () => { const settings = { dots: false, infinite: false, speed: 500, initialSlide: 0, centerPadding: '0px', variableWidth: true, // Enable variable width nextArrow: <SampleNextArrow className={undefined} style={undefined} onClick={undefined} />, prevArrow: <SamplePrevArrow className={undefined} style={undefined} onClick={undefined} />, responsive: [ ], };

markup

<div className='container'> <div className="slickcont"> <Slider {...settings}> {categories.map((category, index) => ( <div key={index} className="filterChip" style={{ width: 'auto' }}> <a href={category.link}>{category.name}</a> </div> ))} </Slider> </div> </div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant