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.

Can't prevent change of current slide

See original GitHub issue

I’d love to be able to prevent a user going to a certain steps until some conditions are met.

It’s great that there are so many events but we need to be able to call e.preventDefault() or something like that. Or even if in a beforeChange callback you could overwrite the nextSlide slide passed in (for example: nextSlide = currentSlide). The closest I got was using slickGoTo inside a setPosition callback but then I realised this was causing an infinite loop and would require me to manage some slick state stuff outside of slick.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:26 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
simeydotmecommented, Mar 14, 2015

think about this logically…

Why would you want to prevent the slideChange when you’ve already triggered the slideChange? - it doesn’t make sense.

If you want to prevent changing slides, then run the logic before you change slides and change the carousel options to disallow interaction… do not allow user to change slides and then stop half way through.

3reactions
kenwheelercommented, Apr 14, 2015

So wait, you want slick to have a disabled state? I’m not sure I have anything set up for that, because I’ve never intentionally wanted to disable its functionality.

If a client came to me wanting this, I’d probably layer a div on top of slick that intercepted and killed events until my condition to enable slick was met. Not a core solution, but likely the simplest.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help prevent changes to a final version of a file
In your Word, PowerPoint, or Excel file, click File >Info > Protect (Document, Presentation, or Workbook) > Mark as Final. The following screen...
Read more >
Remove or change the current theme - Microsoft Support
To change the theme for your presentation, click the Design tab. In the Themes group, click the theme you want to apply. You...
Read more >
Video: Edit slide timings - Microsoft Support
Training: If you've recorded slide timings and find that there are a couple of timings you want to tweak, you don't need to...
Read more >
Screen sharing a PowerPoint presentation - Zoom Support
To stop viewing the screen shared, click the up arrow . Switch back to Powerpoint and click the Slide Show tab. Begin the...
Read more >
Present slides - Computer - Google Docs Editors Help
Tip: If you want to change your presentation or timing, you'll need to copy a new link. Stop publishing. Open a presentation in...
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