Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8086979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:37:15+00:00 2026-06-05T18:37:15+00:00

I am currently developing a private framework for use on WebKit devices. I have

  • 0

I am currently developing a private framework for use on WebKit devices. I have created a series of list views, to which I am applying a class of hover when the user touchstarts on something. Here’s the jQuery / JavaScript code that I am using to add this, and the CSS to matched class:

    $('*').bind('touchstart', function() { $(this).addClass('hover'); }).bind('touchend', function() { $(this).removeClass('hover') });

And the CSS:

 ul li:hover,
 ul li.hover {
     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(5,140,245,1)), color-stop(100%,rgba(1,96,230,1)));
     background: -webkit-linear-gradient(top, rgba(5,140,245,1) 0%,rgba(1,96,230,1) 100%);
     color: #fff
 }       
     ul li:hover a,
     ul li.hover a {
         background-position: right -38px
     }

This seems to work as expected when viewing in Chrome (or some desktop Webkit-enabled Browser), except for the fact that if the mouse position doesn’t move between transitions of screens, the list element on the new screens becomes hovered. This is obviously to be expected, since the :hover pseudo-class has been fired.

However, I didn’t expect the same behaviour to occur in iPhone’s Mobile Safari. Here are some screenshots and a brief explanation of the scenario. I tap once on the List Views element (which is an a element inside an li) and remove my finger from the screen. A new div is shown containing another list. Without tapping anything on the new div which is now displayed, the second li has a class of hover, even though I haven’t touched it…

enter image description here
enter image description here

Can anyone help me debug this, or work out why this is happening on Mobile WebKit? It’s very annoying, as it’s poor HCI. I tried adding the following line to rectify the issue, but no joy:

if(window.location.hash)
{
    var the_hash = window.location.hash.substring(1);
    if($('#' + the_hash).length > 0)
    {
        $('.current').removeClass('current');
        $('#' + the_hash).find('*').removeClass('hover');
        $('#' + the_hash).addClass('current');
    }
}
else
{
    $('div').eq(0).addClass('current');
} 

Advanced thanks for any help, and sorry to ramble!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:37:16+00:00Added an answer on June 5, 2026 at 6:37 pm

    try this

    $('body').bind('touchend',function(){
         $('#p-promotion-main .e-container.hover').removeClass('hover');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently developing a PHP framework and have ran into my first problem. I need
I'm currently developing a Django site in which users can have multiple 'accounts', so
I'm developing a Qt application. For each class, I'm trying to mimic the framework,
I am currently developing an embedded uP based appliance which can be remotely controlled
I am currently developing a game and I'm trying to use one AnimationDrawable to
I'm currently developing an application in which I'm using a plugin system. For providing
I'm currently developing an app using ASP.NET MVC3 and Entity Framework 4.1 Code First
I am currently developing a sharepoint webpart to display a private discussion board. The
I am currently developing a new WPF application and have the majority of my
I am currently developing an android app where I create a notification Intent which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.