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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:54:32+00:00 2026-05-28T14:54:32+00:00

I am trying to use animation using jquery. When i mouseover the element, it

  • 0

I am trying to use animation using jquery. When i mouseover the element, it increases the height and when mouseout, returns to original height.

The Problem is when i mouseover from one element to another element, the previous element’s animation is still performing. how to stop the animation of the previous element?

Fiddle code:

http://jsfiddle.net/EVZVQ/

  • 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-28T14:54:33+00:00Added an answer on May 28, 2026 at 2:54 pm

    Use .stop(): http://api.jquery.com/stop

    $('.div_1').mouseover(function(){
    
        $(this).stop().animate({'height':'200px'},2000);
    }).mouseout(function(){
    
        $(this).stop().animate({'height':'100px'},2000);
    });
    

    Notice you can chain the event binding functions instead of selecting .div_1 twice in a row.

    Here is a demo: http://jsfiddle.net/EVZVQ/1/

    When .stop() is called on an element, the currently-running animation
    (if any) is immediately stopped. If, for instance, an element is being
    hidden with .slideUp() when .stop() is called, the element will now
    still be displayed, but will be a fraction of its previous height.
    Callback functions are not called.

    Source: http://api.jquery.com/stop

    Update

    You can stop all the divs at once like this (but I’m not sure this is the effect you’re looking for):

    var $divs = $('.div_1');
    $divs.mouseover(function(){
    
        $divs.stop().filter(this).animate({'height':'200px'},250);
    }).mouseout(function(){
    
        $divs.stop().filter(this).animate({'height':'100px'},250);
    });
    

    Here is a demo: http://jsfiddle.net/EVZVQ/2/

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

Sidebar

Related Questions

I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am trying to use MAXScript to delete all animation Keys from my scene
I'm trying to achieve some animation using jQuery. I have it working but I'm
I am trying to build a progress bar using jQuery and javascript. It is
I use to work with the animation on jquery but never ajax, so it's
I am trying to add a little animation with jQuery to my navigation bar.
I am trying to use sprite sheet animation in my application. The first POC
Im using phonegap + jquery + jquery iphone touch: http://www.midemos.com/demos/iphone/touch/?/iphone/touch/ Im trying to get
I am trying to use activity transition animaition using OverridePendingTransition The same code works
I am trying to show and hide an inline element (eg a span) using

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.