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

  • Home
  • SEARCH
  • 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 7802807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:22:03+00:00 2026-06-02T01:22:03+00:00

http://jsfiddle.net/jmPCt/18/ I’m quite new to JS and jQuery. I’ve written all the code by

  • 0

http://jsfiddle.net/jmPCt/18/

I’m quite new to JS and jQuery. I’ve written all the code by hand in the link above. It works and does what I want it to save for but one thing. If you click rapidly on the ‘next’ link, you’ll see either a flash of the next container to display or, if you click rapidly enough, the code will display two containers but I only want one to show only at a time. Is there some way of handling this in jQuery? I’ve tried using stops as discussed here: How to prevent jquery hover event from firing when not complete? but this does not solve the issue.

  • 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-02T01:22:05+00:00Added an answer on June 2, 2026 at 1:22 am

    You are looking for .stop(). It’s implementation changes with the desired behavior but the documentation should clear that up for you: http://api.jquery.com/stop

    Here is a demo: http://jsfiddle.net/jmPCt/19/

    Because of how .stop() works, when you use it with .fadeIn() or .fadeOut() you can chop-up your animations to the point where they no longer work. The best fix I’ve found is to always animate to absolute values with .fadeTo(): http://api.jquery.com/fadeTo

    Here is the code I added to your JSFiddle, this overwrites the default .fadeIn() and .fadeOut() jQuery functions with ones that use .fadeTo() and .stop():

    $.fn.fadeOut = function (duration, callback) {
        $(this).stop().fadeTo(duration, 0, function () {
            $(this).css('display', 'none');
            if (typeof callback == 'function') {
                callback();
            }
        });
    };
    $.fn.fadeIn = function (duration, callback) {
        $(this).css('display', 'block').stop().fadeTo(duration, 1, function () {
            if (typeof callback == 'function') {
                callback();
            }
        });
    };
    

    Update

    If you set the position property for the “slide” elements then they can animate on top of each other which will remove the jumpiness that your code exhibits:

    HTML —

    <div id="controls">
        <div id="countah"></div>
        <a href="#" id=prev>prev</a> | 
        <a href="#" id=next>next</a>
    </div>
    

    CSS —

    .js .staceyPort {
        display: none;
        position : absolute;
        top      : 0;
        left     : 0;
    }
    
    #controls{ 
        position   : fixed;
        bottom     : 0;
        left       : 0;
        z-index    : 1000;
        background : gold;
    }​
    

    Here is a demo: http://jsfiddle.net/jmPCt/21/

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

Sidebar

Related Questions

http://jsfiddle.net/B2rdD/3/ I've Created 25 buttons using HTML and I have written jquery code such
http://jsfiddle.net/FS4zT/ If you visit the above link you see what am describing below. Summary:
http://jsfiddle.net/chakri/92tqF/ I need help with the above code. I am trying to disable the
http://jsfiddle.net/SXrAb/ Following the jsfiddle link there is a simplified sample of what I need.
http://jsfiddle.net/fJkBU/1/ That's my code. Basically, I have an iFrame whose source may change. I
http://jsfiddle.net/cwUcM/ I've gone through all of the other threads that seems to have a
http://jsfiddle.net/ujTDf/1/ link text Can anybody help please. The div/form doesn't switsch automaticly in other
http://jsfiddle.net/9BCrs/2/ With respect to the above fiddle how could I use different links in
http://jsfiddle.net/367ms/1/ Please take a look at my code. So what I want to achieve
http://jsfiddle.net/gUckp/ In the above demo, I'd like to show an orange round image BELOW

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.