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 8332961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:52:11+00:00 2026-06-09T02:52:11+00:00

I have a jquery animation that is triggered by a mouseenter on the parent

  • 0

I have a jquery animation that is triggered by a mouseenter on the parent () but If the user “wiggles” the mouse on the child () the animation flickers as though it is switching between the mouseout and mouseenter.

The mouseenter is called on the parent. Why is it also attached to the child and can I prevent this?

example:

http://jsfiddle.net/uqgz9/

I’ve looked into .stopImmediatePropagation(); and .stopPropagation(); I think that may be the right direction but can’t quite get the interaction I need.

Thanks.

  • 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-09T02:52:14+00:00Added an answer on June 9, 2026 at 2:52 am

    Use .mouseleave() instead of .mouseout()

    http://jsfiddle.net/uqgz9/4/

    var imgW;
    
    $('.brand-box-item').mouseenter(function(){
        if($(this).find('img').is(':animated') === false)
            imgW = $(this).find('img').width();        
        $(this).find('img').stop().animate({'width':'0','margin-left':(imgW/2)+'px'},function(){
            $(this).css({'margin-top':'-40px'});
            $(this).stop().animate({'width':imgW+'px','margin-left':'0'});
        });
    });
    
    $('.brand-box-item').mouseleave(function(){
        $(this).find('img').stop().animate({'width':'0','margin-left':(imgW/2)+'px'},function(){
            $(this).css({'margin-top':'0'});
            $(this).animate({'width':imgW+'px','margin-left':'0'});
        });
    });
    

    “The mouseleave event differs from mouseout in the way it handles event bubbling. If mouseout were used in this example, then when the mouse pointer moved out of the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseleave event, on the other hand, only triggers its handler when the mouse leaves the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse leaves the Outer element, but not the Inner element.”
    -jQuery docs

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

Sidebar

Related Questions

I have a jQuery slideDown/slideUp animation that runs smoothly in IE9 and Firefox, but
I have created a jQuery animation that can be seen by clicking the Preview
I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,
I have a jQuery animation that positively refuses to loop. It will play through
I have a jQuery animation that is not working. I think the porblem comes
I have an animation that is mostly working with jQuery and CoffeeScript. I have
I have a jQuery animation that animates the 'scrollLeft' on a container to produce
I have the following jquery that is triggered when a part of my page
I have a jquery animation that toggles the width of a div. Within the
I have jquery function that is triggered by a 'click' handler: $('#showDatesCheckbox').click(function(){ var table

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.