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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:36:42+00:00 2026-06-04T15:36:42+00:00

I have the following code, the animation doesnt appear to be working when I

  • 0

I have the following code, the animation doesnt appear to be working when I want to change the div tag height to 100%. However if I set it to pixels the animation then works.

Any help would be appreciated.

HTML / CSS

    <br />
<div id="biotext" style="width: 400px; height:50px; border: 1px solid #FF0000; background-color: #FF0000; overflow:hidden;">
    Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024 Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024 Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024 Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024  Hello Testing 123 456 789 1024
</div>


    <p><a href="#" id="seemoreb">Click</a></p>

Javascript

$(document).ready(function() {
    $("#seemoreb").click(function() {
        $("#biotext").animate({
            height: '100%'
        }, 1000);
    });

});​

http://jsfiddle.net/4MTyW/

  • 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-04T15:36:43+00:00Added an answer on June 4, 2026 at 3:36 pm

    This is a “bug” per se in jQuery. Not really a bug, but functionality that isn’t there that people may be expecting. The reason why this doesn’t work is because you’re starting with a fixed height and trying to translate that height into a percentage, which CSS can’t really do. If you tried to do this with regular CSS transitions, it wouldn’t work either. I don’t know why, but that’s just how it is.

    However, there is a workaround. You can manually calculate the height of the container you’re trying you expand to and then drop that number in your animation. It’s not too terribly difficult:

    var containerHeight = $('.mycontainer').height();
    $("#seemoreb").click(function() {
        $("#biotext").animate({
            height: containerHeight
        }, 1000);
    });
    

    Of course depending on your application, it may be more complicated than that, but that’s at least why it doesn’t work and how you can get around it.

    Ok I see you don’t have a container in your demo. In that case, rather than using animate, why not just use .slideDown()?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code in my application: // to set tip - photo in
i have following code to show div on page <div id=all_users> <div id=user11 userid=11
I have the following code but doesnt work [self performSelector:@selector([A1 setImage:[UIImage imageNamed:@m1.10002.png] forState:UIControlStateNormal]) withObject:A1
So i have the following code: package animation; import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferedImage;
I have the following code for a fade animation in Javascript: var ticks =
How to give animation to UIImageView. I have a following code for animation .but
I have the following code to animate the showing/hiding of a div. $(.headerClosed, .headerOpen).live(click,
I have the following code to set up and switch to the ABPeoplePickerNavigationController. ABPeoplePickerNavigationController
I have the following code: HTML: <div id=clickme> Click me :-) </div> <div id=info
I have the following code working (in Firefox & Safari only - no worries

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.