``).join('')
: originalSlides;
// Swiper walks its slides on update; leave it alone rather than empty it.
if (! slidesHtml.trim()) return;
if (swiper.params.loop) swiper.loopDestroy();
wrapper.innerHTML = slidesHtml;
slideCount = gallery.length || origSlideCount;
if (gallery.length !== 1) swiper.loopCreate();
swiper.update();
// With the loop rebuilt, index 0 is the copy of the LAST picture: open on the first.
swiper.slideTo(swiper.params.loop && gallery.length !== 1 ? swiper.loopedSlides : 0, 0);
if (thumbSwiper) { thumbSwiper.destroy(true, true); thumbSwiper = null; }
// thumbs.init() reads params.thumbs.swiper (not thumbs.swiper), and every update
// walks thumbs.swiper: neither may keep pointing at the destroyed instance.
swiper.thumbs.swiper = null;
swiper.params.thumbs.swiper = null;
const thumbWrapper = $refs.thumbs.querySelector('.swiper-wrapper');
if (originalThumbs === null) originalThumbs = thumbWrapper.innerHTML;
thumbWrapper.innerHTML = gallery.length
? gallery.map(img => ``).join('')
: originalThumbs;
const thumbSlides = gallery.length || $refs.thumbs.querySelectorAll('.swiper-slide').length;
if (thumbSlides > 0) {
thumbSwiper = new Swiper($refs.thumbs, {
loop: thumbSlides > 1,
spaceBetween: 10,
slidesPerView: 4,
watchSlidesVisibility: true,
watchSlidesProgress: true,
breakpoints: { 320: { slidesPerView: 2, spaceBetween: 20 }, 480: { slidesPerView: 3, spaceBetween: 30 }, 640: { slidesPerView: 4, spaceBetween: 45 } }
});
}
// Swiper reads $el off the thumbs instance, so only re-attach a real one.
if (thumbSwiper) {
swiper.params.thumbs.swiper = thumbSwiper;
swiper.thumbs.init();
}
swiper.update();
// Thumbs built while x-show still hides them have no width: size them once shown.
$nextTick(() => { if (thumbSwiper) { thumbSwiper.update(); swiper.update(); } });
"
x-init="
const thumbCfg = {
loop: true,
spaceBetween: 10,
slidesPerView: 4,
watchSlidesVisibility: true,
watchSlidesProgress: true,
breakpoints: {
320: { slidesPerView: 2, spaceBetween: 20 },
480: { slidesPerView: 3, spaceBetween: 30 },
640: { slidesPerView: 4, spaceBetween: 45 }
}
};
if ($refs.thumbs && $refs.thumbs.querySelector('.swiper-slide')) {
thumbSwiper = new Swiper($refs.thumbs, thumbCfg);
}
swiper = new Swiper($refs.container, {
loop: true,
spaceBetween: 0,
slidesPerView: 1,
watchSlidesVisibility: !0,
watchSlidesProgress: !0,
thumbs: {swiper: thumbSwiper}
});
">
Hieroglyphic 5 - Bookmark
- دار النشر
- Fluffy Bear
- القسم
- فواصل كتب
hieroglyphic 5 Bookmark
14x5.5 cm
قد يعجبك ايضاً
٤٩٥ ج.م.
١٥ ج.م.
١٤ ج.م.