iOS displaying CSS Transform issue exclusively

Creating a website that is fully mobile responsive is my goal. However, after designing the header, I realized that it wasn't displaying correctly on IOS devices like my iPad. The "Transform: translateX(-100%);" statement was functional on Android phones, but not on IOS. I have tried various solutions including using prefixes like -webkit- and using the "!important" statement, but nothing seems to work. Here is the code snippet:

HTML

<!DOCTYPE html>
<h<html lang="en">

<head>
    <title>Home</title>
    <meta charset="UTF-8>
    <meta name="viewport" content="width=device-width, initial-scale=1>
    <link rel="stylesheet" type="text/css" href="style.css">
    <link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Alegreya+Sans' rel='stylesheet' type='text/css'>
    <script src="http://timthumb.googlecode.com/svn/trunk/timthumb.php"></script>
    <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
    <script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
    <script src="js/header.js"></script>
</head>

<body>
    <div class="header">
        <div class="container">
            <div class="logo">
            </div>
            <div class="wrapper">
                <div class="menu-icon">
                    <div class="line first"></div>
                    <div class="line second"></div>
                    <div class="line third"></div>
                </div>
                <div class="nav">
                    <ul>
                        <li><a href="index.html">Home</a></li>
                        <li><a href="http://4para.net/forums">Forums</a></li>
                        <li><a href="about-us.html">About Us</a></li>
                        <li><a href="role-finder.html">Role Finder</a></li>
                        <li><a href="orbat.html">ORBAT</a></li>
                    </ul>
                </div>
            </div>  
        </div>
    </div>

    <div class="container">
       <div class="featured">
            <h1 class="devMode"> Development Mode</h1>
        <p class="devModeText">Our 100% mobile friendly website is still under development. If you would like to provide feedback or suggestion please post them <a href="http://4para.net/forums/showthread.php?tid=28" target="window">here</a>, anything is helpful!</p>
        </div>

      </div>    


</body>

</html>

CSS

@media screen and (max-width: 810px) {

/*header*/
.nav {
    margin: 15px -40px ;
    background-color: #3f3f3f;
    transform: translateX(-100%);
    transition: 0.6s ease;
    -webkit-transform: translateX(-100%);
    -ms-transform: translateX(-100%);

} 

.menu-icon {
    position: relative;
    margin-left: 10px;
    display: block;
    height: 54px;
    width: 54px;
    background-color: #2a2a2a;
    /*border: 0.75px solid #000;*/
    border-radius: 50%;
}

.line {
    width: 38px;
    height: 2px;
    background-color: #fff;
    border: 1px solid #fff;
    border-radius: 5px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.logo {
    float: right;
}

.nav ul li {
    list-style: none;
    display: block;
    padding: 10px 120px 10px 30px;

}   

.open {
    transform: translateX(0);
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
}

.first {
    position: relative;
    top: 15px;
    margin: auto;
} 

.second {
    position: relative;
    top: 20px;
    margin: auto;
}

.third {
    position: relative;
    top: 25px;
    margin: auto;
} 
 /*end of header*/

 .container  {
    margin: 0 10px 0 10px; 
 }
}

JS

$(function() {

$('.menu-icon').on('click', function(){
$('.nav').toggleClass('open');
});

});

UPDATE: I discovered that my website was cached. I enabled the development mode with Cloudflare and surprisingly, both methods are now working. Thanks to everyone who provided quick responses, unlike me.

Answer №1

It may not be necessary, but you could experiment with using translate3d(x,y,z) instead of translateX(x). An example would be:

-webkit-transform: translate3d(-100%,0,0);

The suggestion comes from this GitHub thread

After speaking to an Apple engineer about this, it was confirmed that both 2d and 3d transformations are hardware accelerated when using CSS3 transitions and keyframe animations. There should be no need to make any changes.

It was mentioned that without transitions and keyframes, 2d transformed elements are not accelerated to conserve memory. However, in our scenario, keyframe animations are always used for transitions.

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

Infinite rendering caused by React custom hook

I developed a custom hook that retrieves data from a News API and provides handling for loading, errors, and data (similar to Apollo Client). The issue I'm facing is that the hook seems to trigger infinitely, even when the items in the dependency arra ...

Is there a way to reference a different CSS class within another class?

Currently, I am working on creating a navbar using React. In this navbar, I have three components for the menu bar: text, logo, and buttons. The background color of the navbar is set to transparent, while the components are black by default. However, whe ...

Utilizing CSS to incorporate a background image into HTML code

Is it feasible to utilize pure HTML for the background-image property? Consider the following scenario: The original: background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height=&apo ...

What is the best way to trigger a JavaScript function using an HTML button?

I am trying to trigger a JavaScript file from an HTML component by clicking on a button, but nothing happens when I click the button: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> < ...

Arrange divs adjacent to each other without any gaps in between

My HTML code includes elements from Twitter Bootstrap and AngularJS framework. <div class="item item-custom-first"> <select class="form-control" style="display:inline; float:right" ng-model="requestdata.units ...

To successfully process this file type in JavaScript, you might require a suitable loader

Currently, I am facing an issue with my MVC application while trying to integrate Bootstrap 5 using Webpack. Despite attempting various workarounds with stage-0, stage-2, and stage-3, none have proven successful for me. I suspect that the problem lies wit ...

Invoking two asynchronous functions in React, where the first function relies on the state modified by the second function

Currently, I am working on an app that utilizes the Geoapify API. Within this app, I have implemented three primary API functions. Users are presented with two options on the user interface: they can manually search for cities or utilize their current loca ...

Determine the status of all jqXHR requests within an array to confirm completion

My goal is to execute a block of code once all the jqXHR elements in an array have completed, whether they have succeeded or failed. For the full code, you can check it out here: http://jsfiddle.net/Lkjcrdtz/4/ Essentially, I am anticipating the use of t ...

Connecting Smooch (Sunshine conversations) iOS SDK with Zendesk for seamless integration

I have been following the instructions in this tutorial to set up Zendesk's Sunshine Conversations (Smooch) SDK on my iOS application. After creating an integration from the "Conversations integrations" section of the Zendesk Admin center, I used the ...

tips for rotating a bootstrap background image

I would like to know if it is possible to flip the background image of a section that contains both a navbar and a row in Bootstrap 5. I am aware of using <<transform: scaleX(-1)>> but this flips all the container elements. Is there a way to ac ...

adjust the fixed div's width to match the percentage-defined width of its parent element

My goal is to make a div with the position: fixed property have the same width as its parent element, which is a td. However, I am having trouble achieving this. Here is my current code: HTML: <table style="width: 90%; border: 1px solid black;"> & ...

Tips on transferring information from AngularJS to a remote server using ngResource

Looking for guidance on utilizing the ngResource module? To send data to a server. To retrieve data from a server. I am attempting to send data to a Solr server. Utilizing AngularJS API. Using npm package manager to install packages to my application. Th ...

cPanel is incompatible with node version 12.16.0

I am facing a dilemma regarding hosting my node API, which was built using node version 12.16.0, on cPanel. The available version for node in cPanel is 12.9.0 (Most recent). How should I proceed? Is the node version really a critical factor in this case? ...

how to properly position an image using javascript

I have two tilesheet images and I have successfully rendered them, but I am struggling to figure out how to place the character in front of the map. https://i.stack.imgur.com/n1a3Q.png I have placed these images in two different JavaScript files. This i ...

Combining the power of Node.js and Node-MySQL with Express 4 and the versatile Mustache

Currently, I am delving into the world of Node.js and encountering a bit of a roadblock. My focus is on passing a query to Mustache. Index.js // Incorporate Express Framework var express = require('express'); // Integrate Mustache Template En ...

Options for managing URLs with jQuery

I've been working with a jQuery user interface component called aciTree, which is a tree list that uses Ajax as the data source. When I provide a URL that returns JSON, everything functions properly. However, I need to generate the JSON dynamically an ...

Troubleshooting URL Problems with Node.js Search and Pagination

My results page has pagination set up and the routes are structured like this: app.get("/results",function(req,res){ query= select * from courses where // this part adds search parameters from req.query to the sql query// Object.keys(req.query.search).for ...

Metadata instructions for mobile device management

I'm completely new to MDM servers. Currently, I am using the nanomdm server. Is it possible for me to include my own metadata in the commands or payload that are sent to the device? For example, could I add UDID, which can be later retrieved by my mob ...

Is it possible to utilize the spread operator for combining arrays?

Consider two different arrays represented by variables a and b. The variable c represents the output as a single array, indicating that this method combines two or more arrays into one. let a=[a ,b]; let b=[c ,d]; c=[a,...b] The resulting array will be: ...

Creating a custom date selection component in Angular 2 RC1

Can anyone recommend a datepicker that is compatible with Angular 2 RC1? I noticed that ng2-datepicker seems to be using angular2 RC1, but when trying to install it, it's asking for Angular 2 Beta. Would appreciate any assistance. Thank you in advan ...