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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:30:01+00:00 2026-06-05T03:30:01+00:00

I have a simple JQuery animation that reduces the opacity of a div on

  • 0

I have a simple JQuery animation that reduces the opacity of a div on mouseover, back to 100% on mouseout, and on click moves the div down a few hundred pixels. Simple enough right?

Problem is: User clicks and it starts to move the div but if user moves mouse while its animating, a mouseout event is detected and it cancels the animation.

<!--MOUSEOVER ANIMATION-->

$(".roll").hover(function(){
    var rollid = $(this).attr('id');
    $("#h" + rollid).stop().animate({
    opacity: ".7"
    }, 400 );
});

$(".roll").mouseout(function(){
    var rollid = $(this).attr('id');
    $("#h" + rollid).stop().animate({
    opacity: "1"
    }, 400 );
});

<!--BUTTON CLICK-->
$(".roll").click(function(){
    $(".roll").removeClass("roll");
    var rollid = $(this).attr('id');
    $(".tbox").stop().animate({
    top: "540"
    }, 400,function(){
        $("#p1").fadeIn();
    });
});

Page link is http://www.megadyne.com/safezone/index2.php

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-05T03:30:03+00:00Added an answer on June 5, 2026 at 3:30 am

    The hover function can be used for hover in and out like so:

    $(".roll").hover(function(){
        var rollid = $(this).attr('id');
        $("#h" + rollid).stop().animate({
            opacity: ".7"
        }, 400 );
    }, function(){
        var rollid = $(this).attr('id');
        $("#h" + rollid).stop().animate({
            opacity: "1"
        }, 400 );
    });
    

    By the way you might want to change .stop() to .stop(true, true): http://api.jquery.com/stop/

    Also there is the animation fadeIn & fadeOut: http://api.jquery.com/fadein/

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

Sidebar

Related Questions

I have a simple jQuery animation that moves a div to the right or
I have a simple jquery animation on a div, which is inside a div,
I have a simple animation on my rails site that pop's a div (with
I have a jquery animation that toggles the width of a div. Within the
I have a simple jquery flipcard animation - http://jsfiddle.net/gGAW5/36/ Now the way this flip
I have a simple jQuery script that I'm trying to build upon but I
I have a simple jQuery code that runs on a web page that has
I have a simple animation based on jQuery fadeIn and fadeOut - it just
I have a simple color animation with jquery.color . This is my code: $(document).ready(function(){
I have a simple jQuery script that slides a contact form up from the

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.