Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The image is loading twice #456

Closed
ricardocanelas opened this issue May 7, 2020 · 1 comment
Closed

The image is loading twice #456

ricardocanelas opened this issue May 7, 2020 · 1 comment

Comments

@ricardocanelas
Copy link

ricardocanelas commented May 7, 2020

I don't know if it is a bug or problem of the browser... but after I put the mouse over the image, the Drift-Zoom is loading again the same image.

In my case, I have a big image that I resize by CSS, and I would like to use the same image to the zoom.

Is there any way to fix it?

capture-devtool

capture-devtool-2

capture-devtool-4

@ricardocanelas
Copy link
Author

ricardocanelas commented May 7, 2020

My code:

import Drift from 'drift-zoom';
// ...
componentDidMount() {
  driftInstance = new Drift(document.querySelector(".drift-trigger"), {
    paneContainer: document.querySelector('.drift-detail'),
    containInline: true,
    hoverBoundingBox: true,
    zoomFactor: 3,
    inlinePane: 720,
  });
}
<div className="image-wrapper">
    <img className="drift-trigger" src="myimage.jpg" data-zoom="myimage.jpg"/>
    <div className="drift-detail"/>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant