Open chenweiyj opened 9 years ago
I think the problem is your image width. Notice that it makes no sense to zoom an image if its width is already greater than or equal to a calculated width (screen width - offset):
if (target.width >= ($(window).width() - Zoom.OFFSET)) return // line 34
It's very likely that width:80vw
exceeds the threshold. So I tested it on chrome developer tool with iPhone 5 and an image with width:80vw
:
> $(window).width()
> 320
> $('.img').width()
> 256
Obviously, 256 >= 320 - 80 (offset), the image will not zoom.
I just opened an issue about mobile zooming: https://github.com/fat/zoom.js/issues/75
plugin update: its in line 41 now. Just comment it out or toggle the operators to suit your liking
if (target.width >= ($(window).width() - Zoom.OFFSET)) return
I use responsive design on my website. The zoom works in desktop browser. However, when I test it on my iphone with safari browser, it does not work.
My code for the image is shown as follows.