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

  • Home
  • SEARCH
  • 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 8275543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:06:32+00:00 2026-06-08T08:06:32+00:00

Possible Duplicate: iPad Web App: Detect Virtual Keyboard Using JavaScript in Safari? I’m building

  • 0

Possible Duplicate:
iPad Web App: Detect Virtual Keyboard Using JavaScript in Safari?

I’m building a mobile version for a website, and I’m interested if I can create using jQuery/js/html5 or any other technology the same split screen effect that can be made on mobile apps when virtual keyboard is visible.

For example if a user enters my webpage and clicks on an input text field, the virtual keyboard is showed and the browser automatically zooms to the area where the input text field is.

What I want is to be able to change my page content the moment the virtual keyboard is visible based on the new resolution( screen height – keyboard height), by moving the input text field on top of the screen, followed by some tips depending on what the user enters in the text field.

Here are some sketches to see what I am talking about:

This is the page view without keyboard, results based on the search:

page without keyboard

page with portrait keyboard, the logo disappears, the text input moves to top, and a max 4 items are shown

page with portrait keyboard

page with landscape keyboard, the logo disappears, then input moves to top and is enlarged, only 2 items are shown

enter image description here

is the keyboard is hidden, the page should go to phase 1.

Hope this helps.

  • 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-06-08T08:06:34+00:00Added an answer on June 8, 2026 at 8:06 am

    I have tried a first solution for your problem by catching the resize event
    With that you can know the orientation and gest is the keyboard is visible

    UPDATE : adding iOS mobile safari support with LKM solution

    var is_keyboard = false;
    var is_landscape = false;
    var initial_screen_size = window.innerHeight;
    
    /* Android */
    window.addEventListener("resize", function() {
        is_keyboard = (window.innerHeight < initial_screen_size);
        is_landscape = (screen.height < screen.width);
    
        updateViews();
    }, false);
    
    /* iOS */
    $("input").bind("focus blur",function() {
        $(window).scrollTop(10);
        is_keyboard = $(window).scrollTop() > 0;
        $(window).scrollTop(0);
        updateViews();
    });
    

    Now you can show and hide the logo and some line item

    function updateViews() {
        $("li").hide();
        if (is_keyboard) {
            $("#logo").hide();
            if (is_landscape) {
                $("li").slice(0, 2).show();
            }
            else {
                $("li").slice(0, 4).show();
            }
        }
        else {
            $("#logo").show();
            $("li").show();
        }
    }
    

    For the JS based on this HTML

    <div id="logo">Logo</div>
    <input type="text"><input type="submit" value="search">
    <ul>
        <li>Item</li>
        <li>Item</li>
        <li>Item</li>
        <li>Item</li>
        <li>Item</li>
        <li>Item</li>
        <li>Item</li>
        <li>Item</li>
    </ul>
    

    Check out my example page

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Best way to programmatically detect iPad/iPhone hardware For example I want my
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: Merging existing iPhone and iPad app ids into a single universal app
Possible Duplicate: Is there an handwriting recognition library for IOS? I'm building an app
Possible Duplicate: Can I retrieve an ipad unique device identifier that through Safari with
Possible Duplicate: iPhone/iPad App Code Obfuscation - Is it Possible? Worth it? I have
Possible Duplicate: Convert ipad application to iphone. Universal app I created one application which
Possible Duplicate: Detecting iPad 3 vs iPad 2 device? Programmatically detect an iPad 3
Possible Duplicate: What is the difference between max-device-width and max-width for mobile web? For
Possible Duplicate: Landscape Mode ONLY for iPhone or iPad I'm making an iPad-only app

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.