Concealing the toolbars on iOS 7 with the overlay technique

After researching on Stack Overflow and Google, I have been trying to find a reliable method to hide the toolbars on iOS 7 since the old scroll trick is no longer effective.

I came across this resource:

I attempted the following code:

<!doctype html>
<html lang="en">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
        <style type="text/css">

            *
            {
                padding: 0;
                border: 0;
                outline: 0;
                margin: 0;
            }

            html,
            body
            {
                width: 100%;
                height: 100%;
                overflow: hidden;
            }

            div.content
            {
                position: absolute;
                top: 0px;
                left: 0px;
                right: 0px;
                bottom: 0px;
                width: 320px;
                height: 480px;
                background: orange;
            }

            #scroller {
                height: 100%;
                -webkit-tap-highlight-color: rgba(0,0,0,0);
                overflow: scroll;
                -webkit-overflow-scrolling: touch;
                width: 100%;
            }

        </style>
    </head>
    <body class="default">

        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

        <script>

            setInterval(function(){

                if((window.orientation == 90 || window.orientation == -90) && window.innerHeight != window.outerHeight) {

                    $('#scroller').show();

                } else {

                    $('#scroller').hide();

                }

            }, 1000);

        </script>

        <div class="content">

            <div id="scroller" style="z-index: 100000;position: fixed;top:0;left:0;right:0;bottom:0;">
                Scroll up!
            </div>

        </div>

    </body>
</html>

Unfortunately, the scrollbars do not hide when scrolling up. While the #scroller element hides and shows based on the visibility of the toolbars, it does not hide completely when scrolling up, causing the toolbars to reappear.

Is there a misinterpretation in my implementation?

Answer №1

To remove the Safari Address bar, you can use the following meta tags:

<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

For iOS 7.1 and newer, you can hide the status bar with this meta tag:

<meta name="viewport" content="minimal-ui”>

Answer №2

Allow me to share some insights on the topic at hand.

While I haven't delved deep into the code block you provided, I would like to elaborate on the points discussed in the previous post.

Firstly, I showcased an example of a game implementing an overlay that prompts the player to scroll up until the bars disappear. Once the game detects the absence of bars, scrolling is locked until the player initiates the navigation bars again, creating a loop of sorts.

Additionally, I introduced a technique that disables navigation bar triggering specifically for the top section of the screen, leaving the bottom section unaffected. This necessitates the use of the mentioned overlay, resulting in a partial solution to the issue at hand.

In my opinion, combining these two approaches offers a viable solution for games and other applications requiring a full-screen experience without the need for scrolling.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Strangely Bizarre CSS Quirk

At this website, there seems to be an issue with how the footer displays on Internet Explorer and certain older versions of Firefox. However, it appears perfectly fine on Firefox 3.6.13. Any suggestions on what could be causing this discrepancy? ...

Utilizing react.js and passing props as parameters in recursive functions

When using recursion, I encountered an issue where I am unable to pass the props parameter: class App extends React.Component { constructor(props) { super(props); this.state = { visible: this.props.root, a:this.props.a }; } toggle(){ thi ...

A guide on verifying the percentage value of an element's height in Selenium with Java

I was able to retrieve the element's height in pixels using: element.getCssValue("height") However, the height returned was: Height: 560px What I actually need is for the height to be displayed as: Height: 100% Or perhaps Height: 50% ...

What is the best way to justify Bootstrap 5 navbar items to the right side?

How can you right-align Bootstrap 5 navbar items? In Bootstrap 4, it was ml-auto. However, this does not work for Bootstrap 5. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" dat ...

Instructions on adding the modified data to the list in AngularJS without relying on a database

Currently, I am working on an app development project using Ionic and AngularJS. The main feature of the app is to display a list of car brands along with their respective models in the first UI view. Once a user selects a car brand from the list, they a ...

Is it feasible to create a tabbed layout that is responsive?

Would it be possible to create a layout like this and how would you go about doing it? The container has borders, except at the top where the tabs are located. Only the selected tab should have a border at the top. The text on the tabs should be centered, ...

An illustration of the fundamental concepts of require.js

main.md <markdown> <head> <script data-main="script" src="http://requirejs.org/docs/release/2.1.8/minified/require.js"></script> </head> <body></body> </markdown> script.css defi ...

Creating a complex array structure using checkbox inputs within an Angular application

In my Angular application, I have a list of checkboxes that are dynamically generated using nested ng-repeat: <div ng-repeat="type in boundaryPartners"> <div class="row" ng-show="showBPtype[$index]"> <div class="col-xs-12"> ...

Styling the select dropdown border in Google Chrome

I am encountering an issue with styling HTML select options in Chrome. Despite successfully applying borders to each option in Firefox, I cannot get it to work in Chrome. Can anyone advise on how this can be achieved? <select id="sortingOptions" class= ...

Erase multiple tables using just one query by separating them with semicolons

My task involves deleting multiple tables in a single operation from SQLite. I attempted to separate the queries by semicolon but I did not get the desired outcome. Here is the snippet of code I am currently using: NSString *query = @"DELETE from Friends; ...

Looping through required fields in jQuery based on a CSS class

Is there a way to loop through required fields marked with <input class="required">? Currently, only the first input in the loop is being evaluated. How can I traverse the DOM using a loop to check all input boxes? Thank you for your help. While I ...

Implement Ajax to validate a form directly within the <script> tag

I'm trying to incorporate validation and AJAX within the same <script> tag, but it seems that the AJAX functionality is not working properly. Can you help me understand if I'm doing this correctly? After checking the console, I encountered ...

Creating a popup trigger in ReactJS to activate when the browser tab is closed

I am currently working on an enrollment form that requires customer information. If a user fills out half of the form and then attempts to close the tab, I want to trigger a popup giving them the option to save and exit or simply exit. While I have a jQue ...

The information retrieved from the API call did not meet my expectations; instead, it returned as undefined

In my development project, I have organized my functions in a file called PostApi.js. In another file, Posts.js, I make the call to these functions. However, when using api.getPosts() and data in the Posts.js file, I encounter an issue where it returns un ...

Implement jQuery to target adjacent sibling elements with the same class as the element that was clicked

Below are some elements from a list: <ul id="menu3"> <li>DELI MEATS</li> <li class="subhead">Ham</li> <li class="sub">Cooked Ham</li> <li class="sub">Pepper Ham</li> <li class="s ...

What methods can I use to automate the testing of a UI that relies on a lightbox feature?

As a tester utilizing crossbrowsertesting.com, I have come across a situation where developers integrated lightbox into a web app built on the Drupal platform. When users navigate to mysite.com/home and click on a div that triggers a lightbox effect, addit ...

In JavaScript, find a value in an array and substitute it with the value from the

One of my tasks involves manipulating a string variable in the following manner: domNodes += '<a href="javascript: void(0);" data-role="node_jump" data-node="'+this.tagName.toLowerCase()+'">'+this.tagName + "</a>" + " & ...

CSS: Element with overflowing content fails to display even with the overflow set to visible

I'm trying to enhance a fixed toolbar by adding a dropdown menu, but the .toolbar-dropdown-menu component isn't displaying correctly, as shown in this screenshot (tested on Google Chrome 80.0): https://i.stack.imgur.com/r5Cz0.png Initially, it ...

Instructions for creating a dynamic Google map based on an address

Specifics I am aiming to generate a map based on any address stored within my <span> The address in question is : 410 walker street Lowell MA 01851 The <span> containing the address reads as follows: Address: <span id="address" > 410 w ...

Using CSS animations to animate a div while creating a subtle pause between the two

I am working on creating a notification bar that will be displayed and hidden using CSS animation. My challenge is finding the right delay between the two animations. HTML <div id="notification" class="alert" role="alert"></div> JS $(' ...