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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:00:32+00:00 2026-06-03T03:00:32+00:00

I have a content div, and another div that goes underneath the first. The

  • 0

I have a content div, and another div that goes underneath the first. The first div’s content changes dynamically, and its height changes as necessary. Normally, the second div’s position automatically gets bumped up and down as the height of the first div changes. How can I animate the movement of the second div, preferably using just CSS and JS (no jQuery)?

Here’s a visual:
enter image description here

On the left are my two divs, initially. Sometimes, div1 will expand in height to fit its contents, and div2 is pushed down. How can I animate the movement of div2?

  • 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-03T03:00:33+00:00Added an answer on June 3, 2026 at 3:00 am
    • demo: http://jsbin.com/uwoxek
    function init() {
        var header = document.getElementById('header');
        var header_height = header.offsetHeight;
        header.style.height = '10px';
        header.style.overflow = 'hidden';
        var i = 0;
        var animation = setInterval(function () {
            if (i <= header_height) {
                header.style.height = (10 + i) + 'px';
            } else {
                clearInterval(animation);
                header.style.overflow = 'block';
            }
            i++;
        }, 10); 
    }
    

    ok, maybe some note are required?
    what you have to move is not the “second” div, but the “first”, that by moving will automatically push the second at the bottom ( or end of the first ) hope this help

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

Sidebar

Related Questions

I have some normal content. Then i made another div that is going to
The Idea I have a main PHP page that loads content in DIV's from
I want to parse a html content that have something like this: <div id=sometext>Lorem<br>
I have a div with some inner content that I need to have an
I have a div ( .outer - the viewport) with fixed height that contains
I have something like that: <div style=width:100px;float:left>menu</div> <div style=float:left>content</div> both floats are neccesary. I
I need some jQuery ajax help. I currently have a main content div that
I have a page, with a navigationbar that loads content, from another page, into
I have a web page with large div(for example white) and another div that
I have the following jquery code which loads the #content div from another page,

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.