I'm trying to integrate eBay's great zoom and pan on hover for images into my CSS code. So far, I've managed to zoom into the image without regards of placement and without it panning while the cursor hovers over the image. eBay has a great working code which I'd love to incorporate into my own CSS sheet.
This is what I have so far...
div.product div.gallery img {
max-width: 100%;
max-height: 100%;
vertical-align: middle;
display: inline-block;
}
div.product div.gallery img:hover {
transform: scale(2.10);
-o-transform: scale(2.10);
-ms-transform: scale(2.10);
-moz-transform: scale(2.10);
-webkit-transform: scale(2.10);
transition:transform 0.75s ease;
I was looking into eBay's style sheets, but they have several with so much code. I was overwhelmed. Can anyone more advanced help me out with that code I'm missing? Thank you so much! :)
You need to hide overlapping parts of the image when it's size is increased. I updated your code snippet. I would also recommend to add the transition on the
img, not the:hover.Second, if you want to recreate the
Image Zoomer (Pan Zoom)then you will need to use a javascript plugin to recreate this. I did some research and found some interesting candidates that could help you: