User scalable iframe on iPhone - iphone

I have a web site that is designed to work best with mobile device browsers (iPhone, Android, and Blackberry). The default page of the site uses the following meta key to prevent the user from scaling the page using pinch gestures:
<meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initialScale=1.0,maximumScale=1.0"/>
In some cases, I am showing an image on this page, and I would like the user to be able to use pinch gestures to zoom in/out on just the image. One thought I had was to create an iframe when the user clicks (touches) the image. The iframe would contain a page with the image, and the following meta element designed to allow pinch gestures to scale the image:
<meta name="viewport" content="width=device-width,height=device-height,user-scalable=yes,initialScale=1.0"/>
But the image in the iframe is still not scalable. Is what I am trying to do even possible without navigating to a new page?

I don't think you can scroll on iframes on the iphone browser.

Related

Intermittently cannot scroll full page in Responsive site

On load of a responsive page on an iphone or ipad, maybe one out of every five times the page will scroll most of the way down and then stop. It's as if the page content is ending. If I refresh the page or reorient the device, this then allows me to scroll the rest of the way.
My viewport tag is:
<meta name="viewport" content="width=device-width,minimum-scale=1.0,initial-scale=1.0">
I've gotten this on an ipad2, iphone 4 and 4s both on ios6.
Has anyone seen anything like this?

Mobile website is not showing images according to the width of viewport

I am designing a mobile website and when I see my website in portrait view on iphone/ipod its layout, images everything is perfect but when I change to landscape view everything is showing a little bit zoomed-in. I have tried all the meta tag (viewport) attributes:
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=1" />
What am I missing? I want to continue to allow users to zoom, I just don't want the orientation change to zoom my content in.
The guys behind jQuery Mobile have a solution to this. It works by checking the accelerometer data and disabling zoom while the device is changing orientation.

How do you stop a web page from being zoomed from an iPhone?

Some mobile web sites such as the BBC mobile website stop you zooming in on the main home page on an iPhone - how is this acheived. Is there a directive that has to be included in the HTMl code or something ?
You just need to tell the iPhone not to let the user zoom, with a meta-tag:
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
This should still let your webpage rotate, but not zoom.
It's because the width of the site is set to the native resolution of the iPhone display. Mobile Safari never actually zooms past 100% on any site, on a standard sized site say (1000px wide) it is zoomed out to begin with and you specify the zoom level when double tapping or using the pinch gesture.
To achieve the same effect use a max width on your site to match the resolution of the iPhone which is 320px.
In CSS this would be done like:
div#wrapper
{
width: 320px;
}

IPhone/Safari: Is there a way to stop resizing the page on load?

This is a long shot but I'm hoping there's a way to stop IPhones from resizing a page on load. Problem is if it's a site with a lot of need for refreshing (Say a forum) it gets a little old for users to have to resize that page every refresh.
Is there a way to force Safari/The IPhnone to not minimize the site on refresh that doesn't involve a user changing a setting?
There is a meta tag you can use that will constrain the viewport for the iPhone:
<meta name="viewport" content="width=320" />
From Apple's developer documentation:
Use the viewport meta tag to improve the presentation of your web content on iPhone. Typically, you use the viewport meta tag to set the width and initial scale of the viewport. For example, if your webpage is narrower than 980 pixels, then you should set the width of the viewport to fit your web content. If you are designing an iPhone-specific web application, then set the width to the width of the device.
There is a constant you can use for the iPhone's device width: width=device-width.
Not sure if this link will work, but you can read more about Mobile Safari and the viewport tag on the Apple Developer website

iPhone Full Screen Image

How do I go about making an image or section of the page full screen on the iPhone?
I have an image that is 480 x 320 and I want to pull that up full screen on the iPhone but it has to be within a webpage so that I can make the image a link back to the previous page.
Currently if I drop the image on a blank page and I open it up on the iPhone it just shows up in the top left corner.
Hopefully I'm not in breach of the NDA here, but here goes.
Mobile Safari, by default, renders a page as if that page had been viewed by a desktop browser, with a default width of 980 pixels.
To change this behavior you need to explicitly declare the viewport, which you do via meta tags. If you declare the width to the constant device-width, it'll default to 320 instead of 980, and everything looks great.
<head>
<meta name="viewport" content="width=device-width,user-scalable=no" />
</head>
I'd say set the viewport meta tag in your blank page so Safari knows to render the page at the right size. For more information, see this link:
Apple iPhone Safari Documentation
nice links which may help you further:
How to optimize your website for mobile devices:
http://solutions.treypiepmeier.com/2008/12/01/optimizing-a-website-for-iphone/