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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:49:41+00:00 2026-05-30T02:49:41+00:00

I have the following code: $(#myDiv).hover( function () { $(this).clearQueue().animate({ backgroundColor: #d7df23, opacity: 0.95

  • 0

I have the following code:

      $("#myDiv").hover(
          function () {
            $(this).clearQueue().animate({
                backgroundColor: "#d7df23",
                opacity: 0.95
            }, 250).find(".thumb").clearQueue().animate({
                backgroundColor: "#FFF"
            }, 250).attr('src','myIMG.jpg');
            $(this).next("div").clearQueue().fadeIn(150); // THIS MAY BE WHERE THE PROBLEM IS...
          }, 
          function () {
            $(this).clearQueue().animate({
                backgroundColor: "#222",
                opacity: 0.90
            }, 250).find(".thumb").clearQueue().animate({
                backgroundColor: "#000"
            }, 250).attr('src','myIMGup.jpg');
            $(this).next("div").clearQueue().fadeOut(500); // THIS ALSO MAY BE WHERE THE PROBLEM IS...
          }
    );

The first part of the hover function works fine, but as soon as I need to do anything with the next div I get problems. The code above works if you wait for the animations to complete before moving the mouse over and away, but if you mouseout before the animation is finished on hover the next div vanishes and I can’t get it to appear at all.

Any ideas? I think it might have something to do with all the clearQueue’s I have…

EDIT:

Example HTML:

   <div class="container">
                    <div id="myDiv">
                        <img src="myIMGup.jpg" class="thumb" />
                        <h2>The Header</h2>
                    </div>

                    <div>
                            <h3>Popup Header...</h3>
                            <p>Blah Blah Blah...</p>
                    </div>
    </div>
  • 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-30T02:49:43+00:00Added an answer on May 30, 2026 at 2:49 am

    i think you are looking for stop(true, true) or stop(true, false) depending on whether or not you want your animation to be fluid or not…

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

    hope this helps -ck

    NEW ANSWER:
    use this to hide:

    $(this).next("div").stop(true).animate({opacity:0});
    

    and this to show:

    $(this).next("div").stop(true).animate({opacity:1});
    

    instead of fadeIn() and fadeOut()

    jQuery remembers the start that the opacity is in when you use fadeIn/fadeOut and because you are halting the animation essentially you are “jamming” fadeIn/fadeOut to go to the stopped opacity

    hope this helps -ck

    MOAR ANSWER!!1! :

    if you also need the actual “hide” eg. .display set to 'none'

    use it like this:

    $(this).next("div").stop(true).show().animate({opacity:1});
    

    and

    $(this).next("div").stop(true).animate({opacity:0}, function() { $(this).hide() });
    

    if I were doing this I’d wrap it nicely like this:

    $.fn.myFade = function(fadeIn) {
      return this
        .stop(true)
        .show()
        .fadeTo('fast', +!!fadeIn, function() { !fadeIn && $(this).hide(); });
    };
    
    $(this).next("div").myFade(true); // show
    $(this).next("div").myFade(false); // hide
    

    Fully Functioning Demo Action Activate: http://jsbin.com/isumiw

    hope THIS helps lol -ck

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

Sidebar

Related Questions

I have the following code: $('#MyDiv .TheClass').eq(TheIndex).removeClass('ClassA'); $('#MyDiv .TheClass').eq(TheIndex).removeClass('ClassB'); $('#MyDiv .TheClass').eq(TheIndex).addClass('ClassC'); $('#MyDiv .TheClass').eq(TheIndex).children().each(function ()
i have the following HTML code <div id=myDiv> <p>content</p> </div> and the following JS
I have following code to find if row is selected, which is selected and
I have following code snippet in jquery.In which,I want to animate each element of
I have the following javascript code var myDiv = document.getElementById(myDiv); alert(myDiv); myDiv.style.display = 'none';
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following Code Block Which I tried to optimize in the Optimized section
I have following code in my application: // to set tip - photo in
I have following code in my Application. Comments in my code will specify My
I have following code in my application. [self.navigationController pushViewController:x animated:YES]; It will push a

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.