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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:58:15+00:00 2026-06-08T10:58:15+00:00

My first implementation of my personal learning project of dynamically generated webpages and JQuery

  • 0

My first implementation of my personal learning project of dynamically generated webpages and JQuery project utilized checkboxes and toggle(“slow”) and toggle(“fast”). However, being new to CS altogether, managing the state of checkboxes got q bit complex for my first project. So I switched solely to <label>s and .on('click', function(){...}) and $('*').click(function(){...}) with .toggleClass('hidden') to handle my UX. The CSS for the hidden class is :

.hidden {
    display: none;
}

The problem now is that the toggling of the class happens instantaneously, and I would like the user to be able to see the .toggle() just as .toggle('slow') or .toggle('fast'). how would I convert the following line to achieve this visual feedback?

$(this).toggleClass('hidden');

I have reviewed the APIs for toggle, toggleClass, and slideToggle, and was curious if a certain combination would work. If I have to rewrite it to toggle(), how do I include the showOrHide parameter, along with the “show” or “fast” duration, as I need to verify current state, similar to .toggleClass()‘s [switch] parameter.

  • 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-08T10:58:18+00:00Added an answer on June 8, 2026 at 10:58 am

    You can’t animate the addition or removal of a class – a class is either there or not. The .toggle('fast') effect is produced by animating specific CSS properties of the element before hiding it.

    “If I have to rewrite it to toggle(), how do I include the showOrHide parameter, along with the “show” or “fast” duration, as I need to verify current state, similar to .toggleClass()'s [switch] parameter.”

    Since there is not currently a version of .toggle() that works like this:

    $(this).toggle('fast', showOrHide)
    

    …you can instead do this:

    $(this)[showOrHide ? "show" : "hide"]('fast');
    

    …which is a shorthand way of saying:

    if (showOrHide)
       $(this).show('fast');
    else
       $(this).hide('fast');
    

    If you want to run a callback function on complete of the show/hide then:

    $(this)[showOrHide ? "show" : "hide"]('fast', function() { ... });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an AXIS2/JAX-WS web service using a code first implementation (yes I know,
Anyone has a ready implementation of the Reverse Breadth First traversal algorithm in C#?
i'm writing my first MATLAB O-O application and i'm confused about the implementation of
I currently have a JQGrid implementation. The first time I run the search it
I'm wrapping up an implementation of Spring Security in Grails. This is my first
How did stackOverFlow, excuse me if it wasn't the first implementation of this system.
My first implementation idea is to do simply: bool hasUpperCase (string str) { if(string.IsNullOrEmpty(str))
Inching slowly (but methodically) towards my first implementation of In-app Billing, I reached the
Little bit of a beginner here, working on a personal project to scrape my
I am attempting to write my first implementation of databinding in a WPF form.

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.