Tap on the Secret Menu functions on Tablets, but won't function on any iOS gadgets

For quite some time, I've been working on getting my Wordpress Theme to function properly on iOS devices. However, there seems to be a missing piece or perhaps a misunderstanding of how iOS operates that has led me to tackle this issue blindly.

My goal is to make a menu (essentially a div) appear every time another div is tapped. While this setup works flawlessly on Android, it's proving to be a challenge on iOS.

<script>

var $v = document.getElementsByClassName("midbar")[0];     //the div that triggers the menu appearance
var $x = document.getElementsByClassName("menubar")[0];     //the menu with opacity initially set to 0

$v.addEventListener("mouseup", TapEvent, false);     //I used mouseup, touchend also works

function TapEvent(event) {

    if ($x.style.opacity == 0) {

        $x.style.height = "300px";
        $x.style.opacity = "1";
        $x.style.overflow-y = "auto";

        }

        else {

        $x.style.height = "0px";
        $x.style.opacity = "0";
        $x.style.overflow-y = "hidden";

        }

    event.preventDefault();
    return false;
}

</script>

You can check out the temporary site at: itdctest3.comule.com

The theme switches to mobile mode when the screen size is below 700px. The hidden menu is revealed by tapping on the Black Space to the right of the Site Title at the top of the page.

Any assistance or guidance on where to research would be greatly appreciated. Thank you in advance for your help.

Answer №1

After much trial and error, I stumbled upon a solution that seems to do the trick. However, the mystery remains as to why my initial approach only worked for Android and not iOS.

All it took was enclosing the activating div within a span element with an onclick="void(0)" attribute.

Surprisingly, this simple tweak did the job. Nonetheless, I must conduct thorough testing to ensure everything is functioning smoothly.

A big thank you to everyone who contributed their insights!

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

Using jQuery AJAX to remove data from a table upon successful deletion and retaining the data if deletion is unsuccessful

$.ajax({ type: "GET", dataType: 'html', url: "submitreef" + "?id=" + $id, timeout: 5000, cache: false, success: function(data, status, xhr) { Materialize.toast('Successfully Deleted', 4000); }, error: function(xhr, a ...

Accessing variables within a JSON string using the Request module in the Firefox Add-on SDK

I am facing an issue with my PHP script on the server. The script retrieves variables from the database and returns a JSON string containing image URLs. Here is a sample of the JSON string: [ { 'src':'imageurl1'} , { 'src':&a ...

Is there a way to implement a prepare for segue in order to transition the map to a different View Controller within this code?

I have been attempting to implement a prepare for segue in Swift or push view controller to move a map with a pin from one View Controller to another View Controller but in a smaller version. If someone could provide an example of how to achieve this using ...

Develop a custom npm package with dependencies stored locally and add it to a different package during installation

I have developed three unique custom modules. getcorrespondence-1.0.0.tgz getrediscache-1.0.0.tgz setrediscache-1.0.0.tgz These custom node modules were created using the command npm pack. The module getcorrespondence-1.0.0.tgz has dependencies on two o ...

The Node REST API is slow to respond due to its lengthy processing time

I am facing an issue with my Rest API in node.js as it takes a long time to respond since it needs to request data from suppliers. The problem arises when the response is fully prepared but not displayed on the front end react side. I need a solution where ...

Can a gulpfile be written in ES6 syntax?

Question: Is there a way to write my gulp file in ES6 to utilize import instead of require, and use => syntax in place of function()? I have the option to use io.js or any version of node.js. gulpfile.js: import gulp from "./node_modules/gulp/index.j ...

Are you planning to print the JSON information?

I've been working on mastering JavaScript and decided to create a script that displays all public Facebook statuses related to a specific keyword. However, things aren't going as planned. You can find a sample URL where the JSON data is located h ...

Contrasting $interval and setInterval functions in AngularJs

I am trying to grasp the distinction between $interval and setInterval. I have come up with this test: Dashboard.prototype.updateTotalAppointments = function(){ //console.log(); this.appointmentsCount = this.appointmentsCount +1; console.log(this.appointm ...

Struggling to implement custom media queries in a bootstrap theme

I've customized the Twitter Bootstrap layout for my website, and everything is looking great except for the @media queries. Can anyone help me figure out what's going wrong? HTML: <section id="lessons" class="bg-black no-padding lesson-conte ...

Issue with dialogue not appearing when clicking on a table cell

UPDATE: I am facing a challenge with this code not displaying a dialog upon click.: The issue lies in the fact that nothing happens when the Title is clicked. Any suggestions? The data is present, as removing the .hidden CSS class reveals it. $(". ...

What is Angular's approach to handling elements that have more than one directive?

When an element in Angular has multiple directives, each specifying a different scope definition such as scope:false, scope:true, or scope:{}, how does the framework handle this complexity? ...

Is there a way to access an object stored on my server using JavaScript?

In implementing JavaScript, I wish to define two objects stored in a file named file.txt, and utilize them within my code. For instance, I have included the following snippet in my index.php: var counter = Number(localStorage.getItem('rans')) ...

I created a news platform using Next.js server-side rendering, but I'm having trouble with the export const metadata = { title: "TEST" } not functioning as intended

After building my News Website using Next.js with Server Side Rendering, I encountered an issue with setting the page title. Despite using export const metadata = { title: "TEST" }, the title remained unchanged. The metadata object appears to be ...

Changing the order of a list in TypeScript according to a property called 'rank'

I am currently working on a function to rearrange a list based on their rank property. Let's consider the following example: (my object also contains other properties) var array=[ {id:1,rank:2}, {id:18,rank:1}, {id:53,rank:3}, {id:3,rank:5}, {id:19,r ...

Obtaining values from event listeners in Vue.js across different methods

Looking for guidance on the code snippet provided below. Is there a way to assign the value of "e.detail.name" to "nodeName," and then access it in a different method within the component for an API request? data() { return { nodeName: '' ...

Using angular2's ngRepeat to iterate over XML data

I have successfully transformed my XML data into JSON format to be utilized in Angular 2 within my view. However, as I attempt to loop through the data using a for(var... loop, I encounter an error message stating that it cannot find name array and that th ...

Locate the iframe that invoked a function within its parent element

There are multiple iframes on a page that showcase ads unicorns and bacon to users. Due to the impossibility of detecting an iframe's domready event from the parent (please correct me if I'm wrong), each iframe contains initialization code like t ...

issue with href attribute not functioning as intended

I found this code snippet on this website. It seems to work fine, but when I click on a tab, instead of changing the content in the body (<a href="#tab2success" data-toggle="tab">), it redirects to localhost:9000/#tab2success, which doesn't exis ...

The ng-hide and ng-disable functions are ineffective

For some reason, I am struggling to get both ng-hide and ng-disable directives to work simultaneously in my table row with a button click. It seems that when I define ng-controller="FileDestroyController" alone next to one directive, the other stops functi ...

Adjust dimensions of images in Bee3D carousel

I recently utilized the Bee3d library available on the following Github link: https://github.com/lukeed/bee3d While I found everything to be truly impressive, I am curious if there is a way to adjust the image size. Whenever I attempt to change the image ...