Closed chiragbhansali closed 5 years ago
The background
option behaves like the CSS background
property. You can therefore add a background image to your zoom like so:
mediumZoom('#zoom', {
background: 'url(image.jpg)',
})
Let me know if that helps.
I think he wanted to say that he would like medium-zoom to support zooming images that are defined using the background-image
CSS property of any HTML element (instead of only img
elements).
I would also be interested in this feature.
Oh, I see. What's your use case?
My use case is the customization of a page that I have generated using https://grapesjs.com. GrapesJS shows cards that contain images set as background-image
.
I would like to use this on https://blendy.ml. There are multiple <div>
s that contain images set as background-image
.
My case is that I want to use medium-zoom on top of <v-img>
from Vuetify. It uses background-image
as well
Bug description
The zoom effect doesn't work with background images.
How to reproduce
Try using a background image and initializing it in the JS
mediumZoom(selector, options)
Expected behavior
Zoom will work with background images
Environment
medium-zoom
version: 1.0.2