metafizzy / metafizzy/flickity

Remove Flickity Slider On certain conditions

Open
#1,285 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
7.6k
Forks
593
PR merge metrics
No merged PRs in 30d

Description

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)
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Flickity initialization shown in the issue and the remove method call using flkty.cells. Read the remove API and related implementation or tests to determine how removing the main slider under the stated condition is expected to work. Done means the requested conditional removal works without breaking the product image slider or thumbnail setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.