Skip to content

Replace a slide? #63

@dcaud

Description

@dcaud

I want to replace a slide (without updating all slides because that would be slow).

I was thinking that the add-remove function could work, but I can't figure out how to do that in slickR.

Here's the add-remove function from http://kenwheeler.github.io/slick/:

$('.add-remove').slick({
  slidesToShow: 3,
  slidesToScroll: 3
});
$('.js-add-slide').on('click', function() {
  slideIndex++;
  $('.add-remove').slick('slickAdd','<div><h3>' + slideIndex + '</h3></div>');
});

$('.js-remove-slide').on('click', function() {
  $('.add-remove').slick('slickRemove',slideIndex - 1);
  if (slideIndex !== 0){
    slideIndex--;
  }
});

Can you point me to how this might be done?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions