Sunday, June 23, 2013

How to Scale a jQuery Mobile Site for iOS

The first issue was that the site wasn’t scaling properly when it first loaded and everything was so small that I could barely click on it with my finger.  Certainly, this is not what I’d call optimal for a mobile site.
image
I originally played around with increasing font-size for the body and a few other quick CSS tricks, but nothing really did the trick.  I finally came across a meta tag which seemed to fix this issue. 
  1. <meta content="width=device-width, initial-scale=1" name="viewport">

This is what it looked like after adding this meta tag.

image
However, this created a new issue.  This second issue was that when I rotated from Portrait to Landscape mode, the web page did not scale properly and my toolbar buttons were now cutoff on the right-hand side like this:
image

I found numerous references to this known issue with iOS scaling and even found a few javascript fixes available around the web.  However, after a bit of experimenting, I found that I could fix the issue with just a few tweaks to the meta tag above and using no javascript.  The final meta tag looks like this:
<meta content="width=device-width, minimum-scale=1, maximum-scale=1" name="viewport">

This is what the site looks like now when it’s rotated.

image

Source: http://www.wintellect.com/blogs/rrobinson/how-to-scale-a-jquery-mobile-site-for-ios

Related Posts:

  • Installing apps from unknown sources on Android, iOS, Windows Phone Installing apps from unknown sources in Android Before you may manually deploy apps to your Android device, you have to make sure that you're able to install apps from unknown sources. This Android security setting allows y… Read More
  • Cordova Tutorial Installing Cordova Cordova command-line runs on Node.js and is available on NPM. Follow platform specific guides to install additional platform dependencies. Open a command prompt or Terminal, and … Read More
  • eclipse recognise Lenovo adb devices Eclipse cannot detect Lenovo devices 1. Connect Lenovo device to PC as Built-in CD ROM (Connect to USB Storage). -- Scroll from Connecting USB/Built-in ... 2. Install LenovoUsbDriver_1.0.1.exe  3. Disconnect your de… Read More
  • Configure Fiddler for Android / Google Nexus 7 Configure Fiddler Click Tools > Fiddler Options > Connections. Ensure that the checkbox by Allow remote computers to connect is checked. If you check the box, restart Fiddler. Hover over the … Read More
  • NPM1. npm no license field 2. license should be a valid SPDX license Reference: https://docs.npmjs.com/files/package.json Solved: { "license" : "BSD-3-Clause" } or { "license" : "MIT" } … Read More

0 comments:

Post a Comment