Add methods about previous and next slides in the API?
See original GitHub issueHello again, I was checking the example on CodeSandbox.
I wanted to customize the example to hide the “Previous” button when the first slide is shown and if the “loop” mode is off.
I have seen I can grab the current index position with selectedIndex()
and the total number of slides using groupedIndexes()
but it’s not very obvious and the concept of “grouped slides” is a bit confusing.
Maybe embla
object could expose some convenient methods or properties like isFirstSlide()
, isLastSlide()
, hasPreviousSlide()
and hasNextSlide()
to make the task more convenient?
Or maybe there is a better approach, I may be missing something.
Thank you for your attention!
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Add methods about previous and next slides in the API? #10
Hello again, I was checking the example on CodeSandbox. I wanted to customize the example to hide the "Previous" button when the first...
Read more >adding previous/next slide event listeners for modal lightbox ...
Do be able to found the previous and/or next image you need to know on what image you are. I propose to do...
Read more >Prev & Next Buttons - Embla Carousel
This guide will show you how to add previous and next buttons using the Embla Carousel API. We're going to make use of...
Read more >Creating a Slide Show Using the History API and jQuery
To display slides when a user clicks the Previous or Next button we will use jQuery $.ajax() method. So, add a <script> reference...
Read more >API Methods | reveal.js
We provide an extensive JavaScript API for controlling navigation and checking the current state of a presentation. If you're working with a single...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@davidjerleke Thank you David, I will definitively check the React version, being a heavy user and a big fan of React!
I’m closing this issue but I guess we will talk very soon about the React version.
Keep up the great work!
@davidjerleke Thank you David for your quick answer.
It makes sense even if I’d prefer a little more “expressive” API, but it’s more a personal taste, let’s wait until a second person requests it.
I’m closing the issue since the example you did on CodeSandbox solves the problem.
Congratulations for your 100 first stars on GitHub! ⭐️