What's up with portable devices requiring two taps to hover over one DIV and affect another DIV?

Upon implementing "hover one DIV - affecting another inner DIV," a strange issue arose on iPad/iPhones where it now requires two taps to click on the link within the DIV with the hover effect:

Below is the HTML code:

<div class="portfblock">
    <div id="portfblock1_imgdiv"> <a href="http://photoRadosti.com" target="_blank"> 
                <div class="portfblock_imgdiv_txt_dsc_over">Baby &amp; Family Photography</div> 
              </a>
    </div>
    <div id="portfblock_desc"> <a href="http://photoRadosti.com" target="_blank">photoRadosti.com</a>

    </div>
</div>

CSS:

.portfblock:hover .portfblock_imgdiv_txt_dsc_over {
    visibility: visible; 
}

The first tap triggers the on-hover action, making the sub-div with the class portfblock_imgdiv_txt_dsc_over visible as intended by the hover effect. Only after the second tap does the href link jump.

To view the issue on iPad/iPhone, visit my full page here.

Check out the HTML and CSS snippets along with the problematic section on JSFiddle: http://jsfiddle.net/bubencode/5doLj02e/

While this works well on computers using a mouse, touchscreens require two taps to navigate to the links in website thumbnails.

Has anyone else encountered this issue? Is there a way to disable the hover action when tapping on the div with hover on touchscreen devices, allowing the link href jump after the first tap?

Your assistance would be greatly appreciated!

Sincerely, @bubencode

Answer №1

When it comes to mobile devices, the way hover functions is quite different. Without a cursor, the traditional hover effect is not applicable, so a decision was made to activate hover on the first tap and click on the second. This approach was likely chosen to ensure compatibility with websites that rely on hover for features like drop-down menus.

If hover serves no purpose on touch-screen devices, it may be beneficial to detect and eliminate it in order to optimize your website for responsiveness.

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

Preventing Background Scrolling While Modal is Open in React - Using 'position: fixed' causes the page to unexpectedly scroll back to the top

Currently working on a React website where users can scroll through various posts on the homepage. Each post includes a '...' menu that, when clicked, opens up a modal with additional options. In order to prevent the background from scrolling w ...

There seems to be an issue with the functionality of the Bootstrap Modal

I've been working on incorporating bootstrap login Modal functionality into my code, but for some reason, the screen is not displaying it. Here's what shows up on the screen: The red box in the image indicates where I am expecting my Login Modal ...

Unable to get the splash screen to display at 100% height using CSS

Here is an example of a splash screen I have created. HTML <div id="spalsh"> <span> <img src="{% static 'dbexplorer/img/loading.gif' %}" style="height: 100px;" > </span> </div> CSS #spalsh{ width: 98%; ...

Tips on adjusting the default width of the React player interface

I'm currently utilizing react-player to display a video in my app. The default width it comes with is not responsive, and applying CSS didn't prove to be effective. import ReactPlayer from 'react-player'; <ReactPlayer url="https:// ...

What is the best way to position a div at the bottom of a web page?

I have a question that may seem basic, but I've been struggling to find a solution. Despite searching for answers, none of the suggestions I've come across have worked for me. My application has two main containers - a header and a content div. T ...

ways to clear the float on the right side of an image

So I have two images that I am trying to float, like this: img{ float:left; clear:right; } <img src='http://img1.imgtn.bdimg.com/it/u=1005212286,2432746147&fm=21&gp=0.jpg' alt=''><br> <img src ...

How to Utilize React Native iOS for Sending Emails

My goal is to implement a feature in my react native app that allows users to submit text data through a form and have it automatically sent via email to a predetermined address. The sender and recipient addresses will remain constant for every user, witho ...

The bootstrap navbar dropdown feature isn't functioning properly on iPhones

Currently utilizing "bootstrap": "~3.3.4" within the mean.js framework, I am facing an issue with the navbar dropdown menu. On desktop, everything functions as expected - the dropdown opens and remains open when the icon is clicked. However, once deployed ...

Encountering an issue when transferring information between several view controllers via push-pop navigation

Successfully transferring data from the first view controller to the second view controller using pushViewController. Data is successfully passed from the second view controller back to the First View Controller using popViewController with the help of a ...

Django/Bootstrap: experiencing issues with certain default styles not functioning correctly like nav-tabs and buttons

When using Django in combination with Bootstrap v5, I am encountering an issue where the "nav-tabs" class is not being styled as tabs and gray buttons are not taking on the pill style. It appears that only a portion of Bootstrap is functioning correctly. W ...

The vertical scrolling issue arises when the content exceeds the height of the screen

Seeking a solution to enable scrolling of users within a flexbox menu, I've come across an interesting discovery. When setting a specific height in pixels for my nav element (like 100px), everything works perfectly. However, when I set the height to 1 ...

Connect the CSS file in React index.html to the Flask backend

I am attempting to connect a CSS template that is serving static backend content through Flask with my React frontend. Here is the structure I am working with: client/ src/ components/ menu.jsx public/ ...

Adjust the positioning of the background and create a smooth fade effect for

Is there a way to simultaneously change the background position and display an image in front of it? My current solution involves using a second div with padding to center it, but when I hover over the padding of the first div, the image does not change. ...

The behavior of Mozilla in handling JQuery attr() function may result in variations in design elements such as font-family or font-size

I'm currently working on the login form. Below is my view in CodeIgnitor: <div id="login-form"> <?php echo heading('Login', 2); echo form_open('login/login_user'); echo form_input('email', set_value ...

Python: parsing comments in a cascading style sheet document

I am currently working on extracting the first comment block from a CSS file. Specifically, I am looking for comments that follow this pattern: /* author : name uri : link etc */ and I want to exclude any other comments present in the file, such as: /* ...

Is there a way to access the source code of a Cordova application while it's running on a web browser?

As I dive into the world of mobile app development with Apache Cordova, I'm faced with a challenge right from the start. My main objective is to debug the HTML output generated during runtime. However, despite my best efforts, none of the available b ...

Why aren't CSS variables "calculating" the color?

Can anyone help me understand why I am having trouble assigning block-level CSS variables using values from SASS? Specifically, the line color: hsl(3, 75%, var(--main-color-l)); is not producing any output. My setup involves a static site generator with ...

Ways to eliminate spacing from a bullet point in a list?

Is there a way to eliminate indentation from ul? I attempted adjusting margin, padding, and text-indent to 0, but with no success. It appears that setting text-indent to a negative value works - but is this the only solution for removing the indentation? ...

Achieving perfect alignment both horizontally and vertically using CSS3's viewport height of 100%

I'm trying to utilize CSS3's Viewport Height to create a fullscreen section with a height of 100vh. However, I am encountering difficulties in centering elements both horizontally and vertically within the section. My goal is to have an image and ...

Which is more advantageous for creating a new block in Bootstrap 4 – using ".row" or ".col-12"? And what is the reasoning behind your choice?

Here is a simple example to demonstrate. <div class="container"> <div class="row"> <form class="col-12 form-group"> // some code </form> <div class="col-12"> // some text for description </d ...