elevateweb / elevatezoom

1.03k stars 492 forks source link

ElevateZoom on MagnificPopup #90

Open estebandinamarca opened 9 years ago

estebandinamarca commented 9 years ago

Zoom doesn't work on this "MagnificPopup lightbox"

Even using this method:

    $('.open-lighbox').magnificPopup({
      type:'inline',
      alignTop: false,
      overflowY: 'scroll',
      midClick: true,
    callbacks: {
      open: function() {
        // Will fire when this exact popup is opened
        alert("test");
        $("#img1").elevateZoom({ zoomType: "inner", cursor: "crosshair" });
      }
    }
    });
PutilovAI commented 7 years ago

Same problem. Version elevateZoom = 3.0.8

Faisal-nfl commented 5 years ago

I think that when magnificPopup open it don't have data-zoom-image attribute I tried this variation as I am using gallery & its working fine.

$('.parent-container').magnificPopup({
  delegate: 'a',
  type: 'image',
  gallery: {
    enabled: true
  },
  callbacks: {
    change: function(item) {
      item.img.attr('data-zoom-image', item.src)
      item.img.elevateZoom({
        zoomType        : "lens",
        lensShape : "round",
        lensSize    : 200
      });
    },
    close: function() {
      $('.zoomContainer').remove();
    }
  },
});