Product Thumbnail — Slider With Zoom Effect Jquery Codepen

.thumbnail-track-wrapper::-webkit-scrollbar-thumb background: #9aaec0; border-radius: 10px;

// Set main image and reset zoom function setActiveImage(index) if (index === currentIndex) return; currentIndex = index; const newLargeSrc = galleryItems[currentIndex].large; // Reset zoom before changing image (avoid weird transforms) resetZoomWithGSAP(); // Fade transition effect gsap.to($mainImg[0], duration: 0.15, opacity: 0, onComplete: () => $mainImg.attr('src', newLargeSrc); $mainImg.attr('alt', galleryItems[currentIndex].alt); gsap.to($mainImg[0], duration: 0.2, opacity: 1 ); ); updateActiveThumbnail(); // also reset any ongoing zoom flag currentZoomScale = 1; $mainImg.css('transform', 'scale(1)');

.thumbnail-track-wrapper::-webkit-scrollbar-track background: #e2e8f0; border-radius: 10px; product thumbnail slider with zoom effect jquery codepen

<div class="product-showcase"> <div class="product-grid"> <!-- Zoomable main area --> <div class="zoom-container" id="zoomContainer"> <img class="main-image" id="mainImage" src="https://picsum.photos/id/20/800/600" alt="Product main view"> <div class="zoom-badge"> <i class="fas fa-search-plus"></i> Hover to zoom </div> </div>

.thumb-item.active-thumb border-color: #2c5f8a; box-shadow: 0 8px 20px rgba(44,95,138,0.25); transform: scale(1.02); currentIndex = index

.slider-title font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: #2c3e66; background: rgba(255,255,240,0.6); padding: 0.2rem 0.8rem; border-radius: 40px;

.thumb-item flex: 0 0 auto; width: 85px; height: 85px; border-radius: 1rem; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: all 0.2s ease; background: white; box-shadow: 0 4px 10px rgba(0,0,0,0.05); const newLargeSrc = galleryItems[currentIndex].large

// Update active thumbnail UI function updateActiveThumbnail() $('.thumb-item').removeClass('active-thumb'); $('.thumb-item').eq(currentIndex).addClass('active-thumb'); // optional: scroll thumbnail into view horizontally const $activeThumb = $('.thumb-item').eq(currentIndex); if ($activeThumb.length) const containerLeft = $thumbWrapper.scrollLeft(); const containerWidth = $thumbWrapper.width(); const thumbLeft = $activeThumb.position().left; const thumbWidth = $activeThumb.outerWidth(); if (thumbLeft < containerLeft

.main-image width: 100%; height: 100%; object-fit: contain; transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1); transform-origin: center center; background: #fefefe; pointer-events: none; /* zoom handled by container overlay logic */

Joomla Templates Free Joomla Templates Virtuemart Templates K2 Templates JoomShopping Templates HikaShop Templates SobiPro Templates OpenCart Themes
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes Smartcarex - Phụ Kiện Ô TÔ Bạt phủ ô tô cao cấp Bơm lốp ô tô Máy hút bụi ô tô
bettilt
tempobet