mark-rolich / Magnifier.js

Javascript library enabling magnifying glass effect on an images
MIT License
831 stars 193 forks source link

Don't properly works when thumbnail image size is modified through CSS #3

Closed pherrymason closed 11 months ago

pherrymason commented 10 years ago

When trying to apply magnifier.js to an thumbnail that, because of CSS it ends not being displayed in its original size (for example, when applying the css width:100%; to an image to adjust to its container) the highlighted image area is shown in a different scale:

image

This can be fixed on those browsers that support background-size by adding the thumbnail image real dimensions to magnifier-lens element: Example:

background-size:400px 300px;

But then the large-preview area distorts.

mark-rolich commented 10 years ago

Ive tried to test that issue, but when setting 100% width on thumbnail lens area is displayed at correct size. Could you attach sample code where you experience that issue ?