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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:30:33+00:00 2026-06-06T22:30:33+00:00

Here is a JSFiddle that demonstrates the problem… http://jsfiddle.net/L2NBP/5/ For obvious reasons this code

  • 0

Here is a JSFiddle that demonstrates the problem… http://jsfiddle.net/L2NBP/5/ For obvious reasons this code is a simplified version of my actual code, also shown below.

CSS

#frame { left:0; position:absolute; width:190px; }
.layer { background:#FFF; position:absolute; right:0; top:0; width:190px; }
#process { z-index:1; }
#contact { z-index:2; }
#message { z-index:3; }

HTML

<div id="frame ">
    <div id="process" class="layer">Processing...</div>
    <div id="contact" class="layer"># Results Found</div>
    <div id="message" class="layer">Results Updated</div>
</div>
<button onclick="javascript:ajaxMessage();">Click Here</button>

​
JS

function ajaxMessage(){
    // if( $('#message').is(":animated") ) return;
    $('#contact').fadeOut('slow',function(){
         $('#message').fadeIn('slow')
                      .animate({opacity:1.0},1000)
                      .fadeOut('slow',function(){
                          $('#contact').fadeIn('slow');
                      });
    });
}​

DETAILS

I have a form that submits to AJAX .load(). I am using the UI Slider http://jqueryui.com/demos/slider/ for the inputs. I’m using the range option and have several inputs “sliders” in the form, so the AJAX can potentially be called multiple times a second. I am showing a success message when .load() completes. The message is animated using .animate() http://api.jquery.com/animate/ as you can see in the JS Fiddle link above.

The problem is that the function to display the message will be called multiple times before it completes the first animation. When that happens the animations stack up and “flash” long after the user stopped modifying the form values. I tried this… if( $('#message').is(":animated") ) return; …but it still doesn’t work very smoothly. Basically I need to figure out how to prolong the duration of the animation dynamically, or at least make it appear to work that way. Or delay the success message until after the user has made their last modification to the form… ex: the message doesn’t show utill 2 seconds have passed since the user made a change.

Any ideas?


ACCEPTED ANSWER

Accepted Answer in action… http://jsfiddle.net/L2NBP/7/

Compare this to the original at http://jsfiddle.net/L2NBP/5/ To see the difference click the button multiple times in 1-2 seconds and watch the response text to the right of the button.

  • 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-06T22:30:34+00:00Added an answer on June 6, 2026 at 10:30 pm

    If I’ve got your question right,

    You should use stop()

    like this,

    $('#message').stop().fadeIn('slow').animate({opacity:1.0},1000).fadeOut('slow',function(){
            $('#contact').fadeIn('slow');
    });
    

    Also, do a second animation , when one completes,

    var msg = $('#message');
    msg.stop().fadeIn('slow',function(){
        msg.animate({opacity:1},1000,function(){
            msg.fadeOut('slow',function(){
                $('#contact').fadeIn('slow');
            })
        })
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a simple demo here that demonstrates the problem: http://jsfiddle.net/boblauer/eCugY/ Basically, I want
Here is a sample fiddle: http://jsfiddle.net/K2zyU/4/ The problem I am experiencing is that the
You can see the example here: http://jsfiddle.net/8EHED/8/ This is a tricky problem because I
Here is a fiddle (jsfiddle.net/salman/RQBra/show/) that demonstrates the problem I am facing. The iframes
I have posted a working version here: http://jsfiddle.net/JV2qW/2/ I have a textarea that updates
I've created an example of the problem here: http://jsfiddle.net/jXLSW/ Notice that when you hover
I have a working version of my code here: http://jsfiddle.net/5Hqs3/24/ As you can see,
I have a jsfiddle that demonstrates the problem at: http://jsfiddle.net/michaelajohnsonwa/sDchM/7/ The generated dropdown elements
I have a fiddle here http://jsfiddle.net/WULsZ/1/ I load jQuery first and the code is
I have checkboxes under the thumbnails, here: http://jsfiddle.net/pAYFa/ I want to do that by

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.