question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add methods about previous and next slides in the API?

See original GitHub issue

Hello 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:closed
  • Created 4 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
michaelrambeaucommented, Nov 14, 2022

@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!

2reactions
michaelrambeaucommented, Nov 14, 2022

@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! ⭐️

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found