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

It does not work on mobile browser #56

Open
chenweiyj opened this issue Sep 12, 2015 · 3 comments
Open

It does not work on mobile browser #56

chenweiyj opened this issue Sep 12, 2015 · 3 comments

Comments

@chenweiyj
Copy link

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.

<img ng-src="{{m.image + '-commsg'}}" alt="A photo to complement the communication" style="width:80vw;max-width:300px;background-color:#EAEAEA" data-action="zoom">
@kingdido999
Copy link

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.

@fabiocaccamo
Copy link

I just opened an issue about mobile zooming: #75

@oninross
Copy link

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

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

4 participants