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.

Removing slide on click

See original GitHub issue

Hi,

I’m having a frustrating time trying to remove slides when clicked. I think the problem lies in me not getting the correct index required for the ‘slickRemove’ method.

both of these do not work:

function onClicked(){
    $('#myslider').slick('slickRemove', $(this).index($('#myslider').slick.$slides));
}

function onClicked(){
    $('#myslider').slick('slickRemove', $(this).attr('data-slick-index'));
}

the second one works at first, but as slides are removed ‘data-slick-index’ attr is not updated so the wrong slides start getting removed.

Hopefully there is an obvious solution that I am missing.

Thanks, Damon.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:13

github_iconTop GitHub Comments

19reactions
IanCazcommented, Mar 16, 2016

Not sure if it’s much help, but I worked around my problem by doing a refresh after removing a slide: $(".slickContainer").slick('slickRemove', curSlide, false).slick('refresh');

1reaction
subhak186commented, Jul 16, 2015

Does the data-slide-index update requires adding below snippet to slickRemove API?

_.$slides.each(function(index, element) { $(element).attr(‘data-slick-index’, index); });

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add and delete slides in PowerPoint - Microsoft Support
Single slide - Right-click and select Delete Slide. · Multiple slides - Hold Ctrl and select the slides you want then right-click and...
Read more >
Slick Slider - How to Remove Specific Slides On Click
I am trying to make it work so you can remove a specific slide based on which one is clicked. <div class="slider add-remove...
Read more >
How to delete a slide in PowerPoint - Adobe
To remove multiple slides at a time, hold the Ctrl key and click on the slides you want to remove. Then, just press...
Read more >
How to Delete a Slide in a PowerPoint Presentation
1. Open your PowerPoint presentation and right-click (or hold Control as you click) any slide you want to delete in the left sidebar....
Read more >
How to Quickly Remove All Animation in PowerPoint
Removing animation on one or more slides · In Normal View, display the slide with the animation you want to remove. · Click...
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