• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

  • About Catherine
  • Recipes
  • Main Dishes
  • Printables
  • Let’s Connect

Product Thumbnail Slider With Zoom Effect Jquery Codepen Instant

.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;

/* main product card container */ .product-showcase max-width: 1280px; width: 100%; background: rgba(255,255,255,0.75); backdrop-filter: blur(2px); border-radius: 2.5rem; box-shadow: 0 25px 45px -12px rgba(0,0,0,0.25), 0 4px 12px rgba(0,0,0,0.05); padding: 2rem 2rem 2rem 2rem; transition: all 0.2s ease;

.nav-btn:hover background: #1e2f4b; color: white; transform: scale(0.96);

// DOM elements const $mainImg = $('#mainImage'); const $zoomContainer = $('#zoomContainer'); const $thumbTrack = $('#thumbTrack'); const $thumbWrapper = $('#thumbWrapper'); const prevBtn = $('#prevThumbBtn'); const nextBtn = $('#nextThumbBtn'); product thumbnail slider with zoom effect jquery codepen

.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);

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

/* zoom indicator badge */ .zoom-badge position: absolute; bottom: 16px; right: 16px; background: rgba(0,0,0,0.65); backdrop-filter: blur(6px); padding: 6px 12px; border-radius: 40px; font-size: 0.7rem; font-weight: 500; color: white; letter-spacing: 0.3px; pointer-events: none; font-family: monospace; .slider-title font-weight: 600

/* Thumbnail slider area */ .slider-section margin-top: 0.5rem;

/* slider track */ .thumbnail-track-wrapper overflow-x: auto; scroll-behavior: smooth; scrollbar-width: thin; border-radius: 1.5rem; padding-bottom: 0.5rem;

.thumb-img width: 100%; height: 100%; object-fit: cover; display: block; padding: 0.2rem 0.8rem

// ---------- Build thumbnails dynamically ---------- function buildThumbnails() $thumbTrack.empty(); galleryItems.forEach((item, idx) => const thumbDiv = $('<div>').addClass('thumb-item'); if (idx === currentIndex) thumbDiv.addClass('active-thumb'); const img = $('<img>').addClass('thumb-img').attr('src', item.thumb).attr('alt', `Thumb $idx+1`); thumbDiv.append(img); thumbDiv.on('click', (function(index) return function() setActiveImage(index); ; )(idx)); $thumbTrack.append(thumbDiv); ); // update active highlight after building updateActiveThumbnail();

.nav-buttons display: flex; gap: 0.6rem;

.nav-btn background: white; border: none; width: 38px; height: 38px; border-radius: 60px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); cursor: pointer; transition: all 0.2s; color: #1f2b48; font-size: 1rem;

// Reset zoom animation to original function resetZoomWithGSAP() if (zoomTween) zoomTween.kill(); gsap.to($mainImg[0], duration: 0.3, scale: 1, transformOrigin: "center center", ease: "power2.out", overwrite: true, ); currentZoomScale = 1; isZooming = false;

// 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)');

Primary Sidebar

Recent Posts

  • File
  • Madha Gaja Raja Tamil Movie Download Kuttymovies In
  • Apk Cort Link
  • Quality And All Size Free Dual Audio 300mb Movies
  • Malayalam Movies Ogomovies.ch

Footer

Menu

  • About Catherine
  • Easy and inspired recipes for your busy life
  • Legal and Privacy Policy
  • Let’s Connect
  • Printables
  • Recipes

Copyright Copyright © 2026 Smart GateFoodie Pro Theme