Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda