Sunday, June 23, 2013

jQuery Mobile - Enabling the pinch/zoom for the iPad, iPhone

When jQuery Mobile renders a page, it adds the following meta tag to the head of the document.
1<meta content="width=device-width, minimum-scale=1, maximum-scale=1" name="viewport">
It is the minimum-scale=1, maximum-scale=1 part of the tag which disables the pinch zoom. What we need to do is modify the $.mobile.metaViewportContent variable. We can do this using the following code.
1$(document).bind('mobileinit', function(){
2      $.mobile.metaViewportContent = 'width=device-width';
3});
If we want to restrict the amount of zooming, we can use the following:
1$(document).bind('mobileinit', function(){
2      $.mobile.metaViewportContent = 'width=device-width, minimum-scale=1, maximum-scale=2';
3});

Related Posts:

  • XSL - Select Node by variable name Case 1 <xsl:stylesheet version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:svg="http://www.w3.org/2000/svg"    xmlns:fo="http://www.w3.org/1999/XSL/Format"  &nbs… Read More
  • Java - Format Numberpublic class DecimalFormatExample {         public static void main(String args[])  {               //formatting numbers upto 2 decimal places in Java   &nbs… Read More
  • XSL - Global Variable Change Global Variable in XSL http://stackoverflow.com/questions/9608432/incrementing-and-checking-the-counter-variable-in-xslt Cannot increment a variable in XSLT because all XSLT variables are constant. There are, however, seve… Read More
  • XSL - Select Node Name LocaleName <xsl:value-of select="local-name()" />   Name <xsl:value-of select="name()" /> Select Parent node as node <xsl:value-of select="*[name(parent::*)]" /> … Read More
  • XSL - Special CharactersDegree, ie 45o <fo:character character="o" baseline-shift="super" font-size="5pt" />… Read More

0 comments:

Post a Comment