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

  • Home
  • SEARCH
  • 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 614343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:06:07+00:00 2026-05-13T18:06:07+00:00

I have a BG image animation that relies on the hover callback to revert

  • 0

I have a BG image animation that relies on the hover callback to revert to it’s original state. If I move the mouse quickly over the links, the hovered state sticks. My guess is that I’m moving the mouse off before the first animation completes, so the callback doesn’t register.

Is there a more bulletproof way to write this function?

$('.nav li a').hover(function() {
    $(this).addClass('hovered', 300);
}, function() {
    $(this).removeClass('hovered', 300);
});

(it uses a BGimg plugin to support the speed parameter on add/removeClass)

Testable here: McPherson Industries

  • 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-05-13T18:06:08+00:00Added an answer on May 13, 2026 at 6:06 pm

    This is a common problem and cannot be fixed, I’m afraid – it’s up to the browser to keep up with events, and if it can’t, well, you’re out of luck.

    It might be jQuery’s fault also, though. Hard to say without dwelling into the source code. Anyways, there’s a easy workaround:

    $('.nav li a').hover(function() {
        // When element is hovered, remove hovered state from all elements..
        $('.hovered').removeClass('hovered');
        // ..and add it to this one.
        $(this).addClass('hovered', 300);
    }, function() {
        // This is only needed when exiting an element and not enterin another one
        $(this).removeClass('hovered', 300);
    });
    

    This might not be 100% certain, but it’s better than your current.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have image data and i want to get a sub image of that
I have: image 1:Many imageToTag Many:1 tag I want to issue a query that
i have an image that contains a series of images, e.g.: In the olden
In an iPhone application I'm developing I have a Image View that displays eyes
I have what I thought was a relatively easy Ajax/animation that I'm adding to
I have an image that is animating, until you press the button that says
I have just created a simple animation. Lets say that in one frame I
I could have sworn that I seen a while back that the max image
I have some code that continuously generates UIImage frames for animation. Currently I am
I have an image and on it are logos (it's a map), I want

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.