Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7167037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:30:44+00:00 2026-05-28T14:30:44+00:00

I have a phone gap app that enables/disables zoom dynamically. The app allows Zooming

  • 0

I have a phone gap app that enables/disables zoom dynamically. The app allows Zooming on pages with detailed diagrams, and for the rest of the app disables zoom.

Zoom is altered using the Meta viewport tag:
Enabled:

 <meta id="viewport" name="viewport"
        content="initial-scale=1.0, maximum-scale=3.0, minimum-scale=1.0, user-scalable=yes" />

disabled:

 <meta id="viewport" name="viewport"
        content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />

My problem is that it is possible for a user to zoom in and then go to a page that has zoom disabled. Here they will be locked at the zoomed in level.

I found how to detect the problem here:

Safari iPhone – How to detect zoom level and offset?

But is there a way to programatically, and preferably in JavaScript (to keep the phonegap app crossplatform without custom work), set the zoom level? (presently I am refreshing the document, that works, but it’s probably the slowest possible way to handle it)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:30:45+00:00Added an answer on May 28, 2026 at 2:30 pm

    Concerning Android you can change the zoom programmatically from native code (java) accessing directly to the WebView object.

    E.g.:

    appView = (WebView) findViewById(R.id.appView);
    appView.setInitialScale( (int)globalScale );
    appView.getSettings().setSupportZoom( true );
    appView.getSettings().setDefaultZoom(WebSettings.ZoomDensity.FAR);
    appView.getSettings().setUseWideViewPort(true);
    ...
    

    If you need to trigger zoom modification from javascript I could suggest to write your own Phonegap plugin (it’s not too hard) that bind javascript code to native code that access directly to the WebView object.

    Remember, I think you should avoid to specify extra attributes to the meta tag of your HTML, otherwhise they can override WebView settings. Put just

    <meta name="viewport" content="target-densitydpi=device-dpi"> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ipad phone gap app i want that app should also run
i have recently built my first app using phone gap and have managed to
I have a jQuery Mobile PhoneGap app that loads all of my pages fine,
I have implemented a phone gap app for android using jQuery Mobile and java
I developing a phone gap based app for iPhone and Android. i have my
I have a phone gap app which loads an HTML 5 app in a
We've put together an app that is mostly working in phonegap. We have an
I am building a PhoneGap/Cordova app and have a simple code that uses http://ricostacruz.com/jquery.transit/
I want to have an aspect of an app that calls up the camera
I have a basic ASP.NET MVC 3 app. I have a basic action that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.