Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
panzoom module zoomWithWheel not working as desired

Im using a combination of softwares to achieve a slideshow/lightbox/zoom and pan effect and have reached a barrier with the Panzoom module. My code works like this, the server pre-loads the images that will go into the slideshow and on loading the page, the images are loaded into the carousel (Swiper). Then on clicking an image, the image is opened in a lightbox (GLightbox) and since the zoom function offered with that isnt accurate enough, I wanted to plugin a third software to allow scroll wheel zooming and panning.

HTML:

<div class="swiper mySwiper" id="mySwiper">
     <div class="swiper-wrapper" id="load">
     <% for(let img of images) { %>
        <div class="swiper-slide d-flex align-items-stretch align-items-center justify-content-center"><img class="glightbox img-fluid" src='<%=img%>'style="height:100%;width:auto" data-zoomable="false" data-draggable="false"></div>
      <% } %>
</div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>

here is how Ive implemented the click event for applying the panzoom zoomWithWheel function:

$(document).ready(
()=>{
    $('.glightbox').click(
        ()=>{
            const elmt=$('.gslide-media img')[0];
            console.log(elmt);
            const panzoom=Panzoom(elmt);
            $(elmt).on('wheel', panzoom.zoomWithWheel)
        }          
    )       
})

Pan seems to work fine but my problem now is the scrolling only zooms OUT the image in the lightbox. Help Please!

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda