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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:39:20+00:00 2026-06-03T01:39:20+00:00

When I removeClass(‘below’) , it removes the css class, but when I click on

  • 0

When I “removeClass(‘below’)“, it removes the css class, but when I click on the object again it performs the same action.

I am trying to take away the ability for the click function to work by removing the css code. What am I doing wrong?

$('.below').click(function() {
    $(this).removeClass('below');
    $('#welcome').removeClass('fadeInLeft, bounceOutLeft').addClass('fadeOutLeft');
    $('#welcome_search').delay('500').animate({"top": "-=140px"},"slow");
});

My html looks similar to this:

<div id="welcome_item" class="below">
    stuff
</div>

Please help with this, thank you.

What if I want to rebind the click after I change out the class?

$('.below').click(function() {
    $(this).unbind('click').removeClass('below').addClass('above');
    $('#welcome').removeClass('fadeInLeft bounceOutLeft').addClass('fadeOutLeft');
    $('#welcome_search').delay('500').animate({"top": "-=140px"},"slow");
});

$('.above').click(function() {
    $(this).removeClass('above').addClass('below');
    $('#welcome_search').animate({"top": "+=140px"},"slow");
    $('#welcome').removeClass('fadeInLeft bounceOutLeft fadeOutLeft').delay('500').addClass('fadeInLeft');
});
  • 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-03T01:39:22+00:00Added an answer on June 3, 2026 at 1:39 am

    By the time that jQuery code is run, the click event is already bound to the element with class .below, and everytime you click on the element, jQuery doesn’t actually check the class of the element anymore, so removing class won’t help you with this.

    You can use unbind instead

    http://api.jquery.com/unbind/

    $('.below').click(function() {
        $(this).unbind('click');
        $('#welcome').removeClass('fadeInLeft, bounceOutLeft').addClass('fadeOutLeft');
        $('#welcome_search').delay('500').animate({"top": "-=140px"},"slow");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

removeClass doesn't remove the class selected from div.upvote in the js below, but addClass()
I'm trying to set up a few add/removeClass functions, of the same class, depending
On line 6 below, I have $(ul.tabrow li).removeClass(active); //Remove any active class If I
I am using jquery function which changes the class of element $(a).click(function(){ $(this).closest(ul).find(a).parent().removeClass(active); $(this).parent().addClass(active);
this is how I toggle content $(#content).hide(); $(.toggle).click(function(){ if($(this).attr(class) == toggle){ $(this).removeClass(toggle); $(this).addClass(add_active); }else{
$(document).ready(function() { $(tr).removeClass(); $(tr:gt(0)).click(function() { $(this).css(color, red) }); }); .highlight td { background: red;
I am trying the following but with no luck. $(#mydiv).addClass('spin').delay(1000).$('#mydiv').removeClass('spin'); Any suggestions?
Instead of individually calling $(#item).removeClass() for every single class an element might have, is
I have the following: Javascript: $(.bg .thumb_wrapper).click(function() { $(.bg .thumb_wrapper).removeClass(active); $(this).addClass(active); }); So every
$(#tab1).click(function(){ loadTab(1); $('div.HOMEtabdiv ul.HOMEtabs a').removeClass('selected'); $(this).addClass('selected'); }); Would it be possible to make the

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.