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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:16:51+00:00 2026-05-25T00:16:51+00:00

I have a table. The row is given specific height and overflow is set

  • 0

I have a table. The row is given specific height and overflow is set to hidden. On click, the row will expand down showing hidden contents. I have done this using toggle method. The styling is altered to show contents. This works perfect. But I want to add some sliding animation effect to this. The expansion of row happens immediately after I click it. Instead, I want this to happen in a smooth animated format, like in some jQuery menus. Also I want to hide one open row if another row expands.

You can see a working fiddle Here

  • 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-25T00:16:52+00:00Added an answer on May 25, 2026 at 12:16 am

    Just a way how to do that:
    – Set the height of 40px via jQuery, but before doing that, calculate the height of the
    ‘opened’ element.
    -Than just animate on click.

    DEMO

    var cl4h = $('.class4').height(); // get the height of the opened .class4
    
    $('.class4').css({ height:'40px' }); // set height to 40px;
    
    $('.class4').toggle(function() {
        $(this).animate({ height: cl4h });
    }, function() {
        $(this).animate({ height: '40px' });
    });
    

    P.S.
    Remove height: 40px; for the el .class4 from your CSS


    If you have to use more than one class here is a demo using tha jQuery .data() :

    DEMO with .data()

    $('.class4').each(function(e) {
        var cl4h = $(this).height();    // get height of each element
        $(this).data('height', cl4h);   // and store it into .data (for each el)
    });
    
    $('.class4').css({height: '40px'}); // set heights to 40px on page load
    
    $('.class4').toggle(function() {   
       $(this).animate({height: $(this).data('height') }); // call the el .data where is stored the el height
    }, function() {
       $(this).animate({height: '40px'});
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table row that needs to be hidden when the anchor with
Background I have a table of comments. Each comment belongs to a specific row
I have a table row, and within that, I have a td (whatever it
I have a table row with 4 columns on my ecommerce site and I
I have a table row that has the error message in it. <tr runat=server
I have a data table filled with text in each table row. How do
I have a table where each row has 13 TD elements. I want to
I have a table where every row has a unique id. The last table
if in html table have 5 row, 1 and 2 are safe, 3,4,5 must
how remove html table rows after 2nd row? if in table have 5 row,

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.