metafizzy / metafizzy/flickity
Remove Flickity Slider On certain conditions
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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