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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:42:40+00:00 2026-06-13T11:42:40+00:00

I have an anonymous function handling the procedure following a click event on a

  • 0

I have an anonymous function handling the procedure following a click event on a set of radio buttons.

Within this function some animations take place, and I wish to disable the click event until the function ends to prevent it firing again from within the function.

The function calls the class name common to each radio buttons:

$(".question1").click( function(){  

How can disable any further click events on this class element while the function executes any animations, and reinstate it after they complete ?

I have tried removeClass() and addClass() to achieve this, but it does not seem to work within the function.

I have also tried .off() and .on() with no luck.

The radio buttons themselves are disabled within the function, but because the function is called on the class name, the click event still fires.

Many 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-13T11:42:41+00:00Added an answer on June 13, 2026 at 11:42 am

    Must be something wrong… on/off functions works very well, Also the class selectors.

    Could you put some code? give as a fiddle so we can try to help.

    If you cant give us the code, I will try:

    // triggered only if the class is not disable
    $(".question1:not(:disabled)").on('click', function(){
        // do something...
    });
    

    or

    function theClick(){
        $(".question1").on('click', function(){
            // do something...
        });
    }
    function theAnimation(){
        $("#someId").on('click', function(){
            $(".question1").off('click'); // disable the click
            // do some animation
            // do more...
            // and more...
            theClick(); // finish, so re-enable
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that invokes anonymous functions within a loop, something like this
We have this anonymous function in our code, which is part of the jQuery's
I have the following anonymous function: (function() { var a = 1; var b
I have a method that takes an anonymous function parameter. This function's parameter is
Simple question, but tough answer? I have the following anonymous function inside a class
I have an ajax call within another anonymous function. The problem I am having
Suppose I have a function a: function a() { this.b = 1; this.set =
I have a cell array of anonymous function handles, and would like to create
You have to pass the args variable to the anonymous function, but the anonymous
I have a javascript function, that works fine if it's anonymous but stops working

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.