yonicd / slickR

slick carousel htmlwidget for R
https://yonicd.github.io/slickR/
Other
159 stars 14 forks source link

Replace a slide? #63

Open dcaud opened 2 years ago

dcaud commented 2 years ago

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!

yonicd commented 2 years ago

Thanks for opening the issue. That functionality is not accessible directly through slickR. You could probably do it through shiny with direct JS if you want.