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 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 a div that it have image content .i wanna implement animation when
I have image map that can I move, but this map will be so
I have an animation that slides in an image when the user clicks chat
I have animation that is an image moving from right to left, which is
Well..I have a simple animation that slides 2 image views left and right.. when
I have this code that make an image animation, but I want to call
I have an image view that has two animation images, occuring in 1-second intervals.
I have a canvas animation that sometimes redraws the exact same element over another
I have this simple animation that moves an image from one point to another:
I have a storyboard that animates an image's width. I created the animation with

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.