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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:20:44+00:00 2026-06-06T02:20:44+00:00

I have 2 divs that positioned horizontally ( float:left; width:50%; ). But i want

  • 0

I have 2 divs that positioned horizontally (float:left; width:50%;). But i want give them height:500px with overflow:hidden and display expand/coolapse button on bottom. How to create it with jquery ?

   <div id="tab-two">

        <ul class="nav">
            <li class="nav-one"><a href="#featured" class="current">last</a></li>
            <li class="nav-two"><a href="#core">popular</a></li>
        </ul>

        <div class="list-wrap">

            <ul id="tabclick">

                <li>
            ***content***                       
                            </li>
             </ul>

         </div> 

     </div>
 <style>
 #tab-two {
 background: none repeat scroll 0% 0% #FFFFFF;
 border-radius: 4px 4px 4px 4px;
 border-right: 1px solid #CCCCCC;
 margin: 0pt 1% 5px 0pt;
 padding: 1px 0pt 0pt 5px;
 }
 </style>
  • 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-06T02:20:47+00:00Added an answer on June 6, 2026 at 2:20 am

    I don’t see where you have 2 divs in your code that will function as described. I worked this up for you. You should be able to edit it to fit your HTML/CSS tags:

    <style type="text/css">
    
    .floatBox {
        position: relative;
        float: left;
        width: 50%;
        height: 500px;
        overflow: hidden;
        display: block;
    }
    
    .boxContent {
        display: table;
    }
    
    a.expandLink {
        width: 100%;
        height: 30px;
        background: #059;
        color: #fff;
        position: absolute;
        bottom: 0;
        text-align: center;
        display: block;
    }
    
    </style>
    
    
    <script>
    
    var collapseH = 500; // set the height of your collapse state
    
    $(document).ready(function() {
        $('.expandLink').click(function() {
            var $link   = $(this);
            var $box    = $link.parents('.floatBox'); // get parent with class="floatBox"
            var innerH  = $box.children('.boxContent').innerHeight(); // get height of inner HTML
            var linkH   = $link.height(); // get height of link to add to your animation
    
            if ($box.height() == collapseH) { // if the box is collapsed
    
                // animate to full inner height
                $box.stop().animate({
                    height: innerH+linkH
                }, 500);
    
                // change text of link
                $link.html('collapse');
    
            } else { // if it is expanded
    
                // animate to collapsed height
                $box.stop().animate({
                    height: collapseH
                }, 500);
    
                // change text of link
                $link.html('expand');
    
            }
    
            return false;
        });
    });
    
    </script>
    
    
    <div id="container" style="width: 800px;">
        <div class="floatBox">
            <div class="boxContent">
                <!-- PUT YOUR CONTENT HERE -->
            </div>
            <a href="#" class="expandLink">expand</a>
        </div>
        <div class="floatBox">
            <div class="boxContent">
                <!-- PUT YOUR CONTENT HERE -->
            </div>
            <a href="#" class="expandLink">expand</a>
        </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two divs that I need to position horizontally dependent on the width
I want to have 5 divs horizontally next to each other spanning the width
I have divs that I want to display at specific times throughout the day.
I have two divs that are sliding from right to left. I am having
I have a few divs that I want to animate using jQuery. However, I
What I want is to have mutliple divs after one another, that each is
I have a few divs arranged horizontally that acts as buttons on a navigation
I have a sidebar #sidebar { float: left; position: relative; width: 200px; padding: 20px;
I have three divs: <div class=A>A</div> <div class=B>B</div> <div class=C>C</div> I want them to
I have two divs. One should be positioned 5% from the left window border,

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.