Centering Selected Item in Flickity asNavFor Carousel
Thank you for your kind words! Regarding your question, to center the asNavFor item when it is selected in Flickity, you can use the cellAlign property with the value center. Here's an example of how you can achieve this:
$('.main-carousel').flickity({
  // options for main carousel
});
$('.nav-carousel').flickity({
  // options for nav carousel
  asNavFor: '.main-carousel',
  cellAlign: 'center',
});
By setting cellAlign: 'center' on the nav carousel, the selected item will be centered when it is active.
I hope this helps! Let me know if you have any further questions.
原文地址: https://www.cveoy.top/t/topic/qllN 著作权归作者所有。请勿转载和采集!