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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:32:45+00:00 2026-06-15T21:32:45+00:00

I have a wrap element that is hidden initially. Once clicked the hidden element

  • 0

I have a wrap element that is hidden initially. Once clicked the hidden element needs to have a visible class added, before performing a toggle animation on another element. Then once clicked again, the animated element needs to toggle it’s animation, and then remove said class from the wrap.

Here is what I have thus far. The initial click performs fine. Class is added, and animation is performed. But on click again the animation is performed properly, but once it is completed, the class is not removed.

$(document).ready(function () { 
$('.search-btn').click(function() {
    if ($('.search-form-wrap').hasClass('hidden')) {
        $('.search-form-wrap').addClass('visible', function() {
            $('.search-form').blindLeftToggle('slow'); 
        });
    }
    else {
        $('.search-form').blindLeftToggle('slow', function() {
            $('.search-form-wrap').removeClass('visible'); 
        });
    }
});
});

This seems to work based on the code from Blazemonger, with the addition of $('.search-form-wrap').hide();

$(document).ready(function () { 
$('.search-form-wrap').hide();
$('.search-btn').click(function() {
    if ($('.search-form-wrap').is(':hidden')) {
        $('.search-btn').toggleClass('active'); 
        $('.search-form-wrap').show();
        $('.search-form').blindLeftToggle('slow'); 
    } else {
        $('.search-form').blindLeftToggle('slow', function() {
            $('.search-form-wrap').hide();
        });
    }
});
});
  • 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-15T21:32:46+00:00Added an answer on June 15, 2026 at 9:32 pm

    That’s because you’re testing if it .hasClass('hidden'). If you’re adding/removing the visible class, you want to test if it’s .not('.visible') instead.

    UPDATE

    If, however, you meant you want to test if the element is hidden or visible WITHOUT using classes, use the :hidden and :visible selectors instead of classes:

    $(document).ready(function () { 
        $('.search-btn').click(function() {
            if ($('.search-form-wrap').is(':hidden')) {
                $('.search-form-wrap').show();
                $('.search-form').blindLeftToggle('slow'); 
            } else {
                $('.search-form').blindLeftToggle('slow', function() {
                    $('.search-form-wrap').hide();
                });
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an element that is similar to a tag (because it has word-wrap:
I have a wrap panel that will contain a variable amount of controls. I
I have set the eclipse java formatter to wrap lines that exceed 120 characters
I have some buttons that has a class name NextButton on my document. There
I have an options button that, when clicked on, will display a dropdown list
I have a wrapper div element that contains a div that in turns contains
I have a DIV element that appears when a certain action is performed. For
I have list view with custom row layout (list_row.xml) that contains CheckBox element: <TableLayout
So, let's say that I have an element that is inline-block. So this won't
Hi I have a wrap() that is working fine, but the problem is, I

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.