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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:48:20+00:00 2026-05-25T02:48:20+00:00

I have the following js function and I would like to prevent anything from

  • 0

I have the following js function and I would like to prevent anything from happening and queueing once the click event has happened. Then when the function ends allow the click event to happen again.

$("#tweet_activate a").click(function(){    
if($('body').hasClass('home')) {
$(this).parent().stop(true,true).animate({top: "+=154"}, 400).delay(1200).fadeOut();
} else {
$("#int_comp").animate({width: "+=157"}, 100);
$(this).parent().stop(true,true).animate({top: "+=154"}, 400).delay(1200).fadeOut();
}
$("#tweet_text").delay(400).animate({right: "+=56"}, 400);
$("#tweet").delay(900).animate({right: "+=214"}, 400);
$("#tweet_deactivate").delay(1200).fadeIn();
$("#tweet_text p, #tweet_text span, #tweet #links").delay(1200).fadeIn();
$("#eye").delay(600).fadeOut();
return false;
});

$("#tweet_deactivate a").click(function(){
if($('body').hasClass('home')) {
} else {
$("#int_comp").animate({width: "-=157"}, 400);
}
$("#tweet_text p, #tweet_text span, #tweet #links").fadeOut();
$("#tweet").stop(true,true).animate({right: "-=214"}, 400);
$("#tweet_text").delay(400).animate({right: "-=56"}, 400);
$(this).parent().delay(900).animate({top: "-=154"}, 400).delay(200).fadeOut()
.delay(600).animate({top: "+=154"}, 100);
$("#tweet_activate").animate({top: "-=154"}, 500).delay(650).fadeIn();
$("#eye").delay(1000).fadeIn();
return false;
});

The site is here – http://danielhollandphotography.com/

If you click on the ‘plus’ sign on the right icon grid you’ll see the sequence happen. If you click the icon mid way through you’ll see it fire again.

Thanks, Matt

  • 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-25T02:48:20+00:00Added an answer on May 25, 2026 at 2:48 am

    Just add a small check to the element.Once you start the animation set a bool to true, on click make that your first check

    var animating = false;
    $("#tweet_activate a").click(function() {
        if (animating !== true) {
            animating = true;
            if ($('body').hasClass('home')) {
                $(this).parent().stop(true, true).animate({
                    top: "+=154"
                }, 400).delay(1200).fadeOut();
            } else {
                $("#int_comp").animate({
                    width: "+=157"
                }, 100);
                $(this).parent().stop(true, true).animate({
                    top: "+=154"
                }, 400).delay(1200).fadeOut();
            }
            $("#tweet_text").delay(400).animate({
                right: "+=56"
            }, 400);
            $("#tweet").delay(900).animate({
                right: "+=214"
            }, 400);
            $("#tweet_deactivate").delay(1200).fadeIn();
            $("#tweet_text p, #tweet_text span, #tweet #links").delay(1200).fadeIn();
            $("#eye").delay(600).fadeOut(function() {
                animating = false; // this is a guess. but place this where ever the animation is stopping. 
            });
        }
        return false;
    });
    

    This should work. Give it a try.

    $("#tweet_activate a").click(function() {
        $this = $(this);
        if ($this.attr("is-animated") !== "true") {
            $this.attr("is-animated", "true");
            if ($('body').hasClass('home')) {
                $this.parent().stop(true, true).animate({
                    top: "+=154"
                }, 400).delay(1200).fadeOut();
            } else {
                $("#int_comp").animate({
                    width: "+=157"
                }, 100);
                $this.parent().stop(true, true).animate({
                    top: "+=154"
                }, 400).delay(1200).fadeOut();
            }
            $("#tweet_text").delay(400).animate({
                right: "+=56"
            }, 400);
            $("#tweet").delay(900).animate({
                right: "+=214"
            }, 400);
            $("#tweet_deactivate").delay(1200).fadeIn();
            $("#tweet_text p, #tweet_text span, #tweet #links").delay(1200).fadeIn();
            $("#eye").delay(600).fadeOut(function() {
                $this.attr("is-animated", "false");
            });
        }
        return false;
    });
    

    you can see the key is the attr(“is-animated”); I cannot do the check in the main button because that has already defined the click event before I have applied the attribute. Strange. Ohh well, if you wrap the contents of the click event in a if statement like I did in the previous example it works. Unlike the previous example however I am attaching a attribute to the anchor tag here and reading it to see if it is in a state of animation. This way you can have multiple elements with this type of event ‘blocking’

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

Sidebar

Related Questions

I have the following scenario: $(#element).blur(validate).change(onElementChange); The validate() function should prevent the change event
I have the following function that is pulling data from a database. The ajax
I have the following function: CREATE FUNCTION fGetTransactionStatusLog ( @TransactionID int ) RETURNS varchar(8000)
I have the following function: //Function to get random number public static int RandomNumber(int
I have the following function: - (NSString *)urlEncodedValue { NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(
I have the following function void initBoard(int * board[BOARD_ROWS][BOARD_COLS]){ int z = 0; for(
I Have the following function. function ChangeDasPanel(controllerPath, postParams) { $.post(controllerPath, postParams, function(returnValue) { $('#DasSpace').hide(slide,
I have the following function sending an email twice (and I believe running if($result)
I have the following function that deletes the LaTeX command surrounding the current cursor
I have the following function: >>> def rule(x): ... rule = bin(x)[2:].zfill(8) ... rule

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.