Internet Explorer (on mobile devices) does not display submenus when touched

Hello, I have a query about displaying a sublist on touch. I have created a sublist that is supposed to show up when you hover over it. You can view the demo here:

@import url(//fonts.googleapis.com/css?family=Titillium+Web:400,200,300,600,700);
 body {
  font-size: 18px;
  line-height: 1.42857143;
  color: #000;
  background-color: #fff;
  font-family: 'Titillium Web', sans-serif;
  margin: 50px;
}
a {
  color: #000;
  text-decoration: none;
  background-color: transparent;
}
.wrapper {
  display: block;
  position: relative;
  float: left;
}

...

<div class="wrapper">
  <a href="#">
    TOUCH ME 1
  </a>
  <div class="subitems">
    <a href="#">ITEM 1.1</a>
    <a href="#">ITEM 1.2</a>
  </div>
</div>

...

When I try to touch the buttons in Chrome/Firefox, the submenu appears. However, IE does not seem to show it for some reason. Can someone explain why and suggest a solution?

I have not used any jQuery code. I am relying on standard browser functionality. If adding jQuery code is necessary for it to work universally, I am open to that.

P.S. My focus is solely on touch events, not mouse clicks.

Answer №1

After reading through this Microsoft article, I decided to try it out on a Windows phone using IE 10/11 mobile.

By including the aria-haspopup="true" attribute, I found that it worked for the initial click, essentially mimicking the behavior of a hover event.

<a href="#" aria-haspopup="true">
    TOUCH ME 2
</a>

Check out this example.

Answer №2

To ensure IE is operating in standards mode, it is important to include a doctype declaration like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

For more information, you can visit the official documentation page

When using the adjacent sibling selector (+ sign in css):
1. Requires Windows Internet Explorer 7 or higher.

2. Combinators are only functional in standards-compliant mode (strict !DOCTYPE).

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

Can you provide the Angular JS alternative for executing a POST request similar to this Curl command?

Trying to translate a Curl command into Angular JS code has been a challenge for me as a newcomer to AngularJS. This specific instance involves a mobile app built on the ionic framework, which utilizes Angular JS. The original curl command looks like this ...

Failure to trigger custom event on FB pixel

I have installed the FB pixel helper browser plugin and I am confident that the FB pixel is properly implemented, as it is tracking pageviews correctly. However, I am facing an issue where the code for reporting a custom event is not working, even though ...

Performing an axios request using form data in a React JS application

I am trying to figure out how to use axios in react js to make a cURL request that is currently working. Here is the cURL request: curl -k --request GET "BASE_URL_SERVER/sendText" --form "user_id='uidxxxx'" --form "sign_id=" Every time I try to ...

Ways to eliminate all attributes and their corresponding values within HTML tags

Hey there, I'm trying to strip away all the attribute values and styles from a tag in html Here's my Input: <div id="content"> <span id="span" data-span="a" aria-describedby="span">span</span> <p class="a b c" style=" ...

Is it possible to run npm scripts directly?

There is a script in my package.json file "start": "cross-env NODE_ENV=development PORT=3000 CODE_SPLIT=0 node ./react-imvc/bin/www-babel-register", I need to run the script with the --inspect flag, but I am unable to modify the package.json. I would lik ...

Objects remaining static

I'm currently working on a VueJS component that has the ability to export data into .xlsx format. To achieve this functionality, I am utilizing the json2xls library, which requires an array of objects with identical keys (representing column names) to ...

Positioning a div at the bottom of the viewport, centered with 2 rows of 6 elements, and adjusting its size to fit the page

I've searched for answers but haven't found anything that works for me. I'm looking to have 2 rows of 6 elements at the bottom of the page and have them stick there as the page scrolls. I tried using a table, which almost worked. .center ...

Are there any modules in Angular 8 that are used across various projects?

I am facing a challenge with managing two projects that share the same core functionality. These projects have identical layouts and pages, but certain components and modules are specific to each project. Currently, I maintain two separate Angular projects ...

Eliminate custom CSS generated by themes on WordPress category pages

I am a newcomer to the world of Wordpress and I'm currently in the process of making adjustments to an existing theme. The theme itself is generating custom CSS code and adding it to the wp_head section. add_action('wp_head', 'custom_c ...

Implementing a NextJS button using the Link component

I am curious about how to incorporate a button inside a NextJS Link component. Usually, when you wrap the button in a Link and click on it, the onClick event is triggered and then it redirects to the value specified in the href attribute. Is there a way t ...

Transforming JavaScript array UNIX timestamps into JavaScript Date objects

Is there a way to convert UNIX epoch integers into JavaScript Date objects using jQuery? Attempting to pass a large JSON array generated by PHP to Highmaps.JS, which works almost great. However, Highmaps expects a Date object and Date objects aren't ...

Comparing the functionalities of C#, Python, and JavaScript, including rounding methods

There seems to be a difference in how decimal numbers are rounded in C# or Python compared to Javascript. I came across a solution for banker's rounding on Stack Overflow, but it doesn't work as expected in my scenario and leads to discrepancies ...

Assistance with Jquery for toggling checkboxes when labels are clicked

I'm currently working on a feature that allows for checking and unchecking checkboxes upon label click. You can find my Jsfiddle here: http://jsfiddle.net/PTAFG/1/ The HTML structure cannot be altered Here is the snippet of my HTML: <div style= ...

Ensure that the jQuery Knob is set to submit any modifications only after the final adjustment

Utilizing jQuery Knob by anthonyterrien, I have configured the step to be 20. My goal is to transmit the knob's value to the server. The issue arises when the change function is triggered every time the user adjusts the knob using either a right or le ...

When navigating to a different page in Chrome, the Html5 audio player unexpectedly halts playback of the

During my ASP.NET MVC project, I integrated an HTML5 audio player. However, I noticed that when switching to another page, the player paused or stopped playing in Chrome but continued in Firefox as I had saved the player content in a hidden field. Is there ...

Hovering over the Instagram icon will reveal a stunning visual effect

I am looking to change the appearance of my Instagram icon when hovering over it. I want the background to turn white and the icon to become colored. Here is my code snippet from Footer.js : <a href="https://www.instagram. ...

Inheritance through Parasitism in JavaScript

Just finished a Douglas Crockford lecture where he introduced the concept of parasitic inheritance in JavaScript. This involves one constructor calling another to modify the object. The code example he provided is: function gizmo(id, secret) { secret = ...

Adjust the tally of search results and modify the selection depending on the frequency of the user's searches within an array of objects

Seeking assistance with adding a new function that allows users to navigate to the next searched result. Big thanks to @ggorlen for aiding in the recursive search. https://i.stack.imgur.com/OsZOh.png I have a recursive search method that marks the first ...

Manipulating Width in CSS

I am facing a challenge with the HTML code below where an automated software inserts the initial CSS style g2f0 <div class="linelevel row"> <div class="g2f0 col-sm-6 form-group"> <label for="name">Name</label> < ...

Is it advisable to store JSON data in data params instead of making an AJAX call?

Previously, I stored my component data within the element's data parameter. Should I continue doing this or switch to using an Ajax call to fetch the data? 1. Using data parameter: <a href="#" data-core="{JSON-data}" id="item-1"> <a href ...