SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    enable pinch zoom on mobile with meta tag

    I'm working on my first mobile site and need to make an image pinch zoomable.

    I read that including this meta tag will enable it:

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />

    My questions are:

    Which of those attribute enables it?

    With that meta tag, if I display an image, say 600 x 1000, on an iphone screen, will it just automatically scale down to fit the screen, and automatically be pinch zoomable?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,330
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Pinching/zooming is enabled by default, isn't it? It's more a case of whether or not you prevent it.

    If you use this:

    Code:
    maximum-scale=1.0, user-scalable=no;
    you will prevent the user from zooming in, which is a bad idea for a website. (There may be some apps for which it's appropriate, but I doubt any website can justify this.)

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Ok, I didn't ask the right question but you still solved the problem! thanks.

    So, this design does call for pinch/zoom of the site to be DISabled. But in the design some images need to be pinch/zoom ENabled. So how do you enable pinch/zoom for single images?

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,330
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    I think that's called 'keeping your cake and eating it too'. But I could be wrong. One thing that comes to mind is some kind of JS script that shows a larger image upon clicking on the image.

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2010
    Posts
    197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ok

    i'll google a bit and post if i find anything..

    thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •