Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Flickity Slider On certain conditions #1285

Open
Asad-ullah-pp opened this issue Oct 20, 2023 · 0 comments
Open

Remove Flickity Slider On certain conditions #1285

Asad-ullah-pp opened this issue Oct 20, 2023 · 0 comments

Comments

@Asad-ullah-pp
Copy link

I have used the flickity for product image slider and i want to remove the main slider mages to remove on certain condition.
i have used the remove method in another file.

var elem = document.querySelector('.carousel.product__image-slider');
  var flkty = new Flickity(elem, {
    contain: true,
    imagesLoaded: true,
    lazyLoad: 1,
    wrapAround: true,
    pageDots: false,{% if product.images.size < 2 %}
      prevNextButtons : false,{% endif %}adaptiveHeight: true
  });
  console.log("check product main Slider:", flkty);

  var elemThumbnail = document.querySelector('.carousel.product__image-thumbnail');
  var flktyB = new Flickity(elemThumbnail, {
    asNavFor: '.carousel.product__image-slider',
    contain: true,
    imagesLoaded: true,
    lazyLoad: 7,
    pageDots: false,
    prevNextButtons: false
  });
  
flkty.remove(flkty.cells)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant