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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:01:54+00:00 2026-06-16T07:01:54+00:00

I have used jQuery’s slideToggle on a <div> to give the good old ‘dropdown’

  • 0

I have used jQuery’s slideToggle on a <div> to give the good old ‘dropdown’ effect.

I had it working exactly how I wanted in chrome. I then tried it in IE and came across something quite odd.. I could see the animation fine, the <div> would expand to its full height, but then when the animation finished, the <div> would disappear?

I tried a few different things to stop it doing it and it turns out that giving the <div> any min-height (I gave it 1px) allows it to work.

I’d really like to know why it’s neccessary to give a min-height in IE to make this function work properly? It’s no big deal having it there but I’d rather understand why I have to have it there. Code below.

The HTML Structure

<div class="home_popConfiCont rbAll">
<div class="home_popConfiHead">Your Confidential Details<div class="arrow-up"></div></div>
<div class="home_popConfiBody">
    Lots and lots of text
</div>
</div>

jQuery

$(function(){
    var confOpen = 0;
    $(".home_popConfiHead").click(function(){
        if(confOpen){
            $(".arrow-up").attr("class","arrow-up");
            $(".home_popConfiBody").stop(true, true).slideToggle(100);
            confOpen = 0;
        }
        else{
            $(".arrow-up").attr("class","arrow-up arrow-down");
            $(".home_popConfiBody").stop(true, true).slideToggle(100);
            confOpen = 1;
        }
    });
});

The CSS applied to the said <div>:

.home_popConfiBody{padding:5px 5px 0 5px; display:none;line-height:20px;min-height:1px;}
  • 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-16T07:01:55+00:00Added an answer on June 16, 2026 at 7:01 am

    You are probably running into the “hasLayout” issue.

    http://reference.sitepoint.com/css/haslayout

    There are a number of things that can give your div a layout, you have discovered one of them: min-height. In addition to min-height you can also use these values (taken from the referenced article):

    • display: inline-block
    • height: (any value except auto)
    • float: (left or right)
    • position: absolute
    • width: (any value except auto)
    • writing-mode: tb-rl
    • zoom: (any value except normal)4
    • min-height: (any value)
    • max-height: (any value except none)
    • min-width: (any value)
    • max-width: (any value except none)
    • overflow: (any value except visible)
    • overflow-x: (any value except visible)
    • overflow-y: (any value except visible)5
    • position: fixed

    I think people will generally use zoom: 1 to trigger layout because it doesn’t have any noticeable visible effect on the page contents.

    If the div I am toggling has floated elements inside of it, then I will generally apply an overflow: hidden; to the div. This causes the div to expand to the height of the floated elements inside.

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

Sidebar

Related Questions

I am working on a website: http://homegym.sg/index.php/ Have used jquery to create an effect
I have used JQuery within my asp.net page. JQuery is working fine. I could
I am working on some website , i have used jQuery UI , for
Drag is not working after dropping on the area. I have used Jquery UI
jQuery return links are not working. I have Used jQuery and the basic Ajax
I have used jQuery library to find out height of a div . Below
I have used Jquery for rounded corners (DIV) and i have a updatepanel which
I have used jquery datepicker in my .aspx page. The control is working fine.
I have used jquery to create a simple slideup/down effect when user clicks on
I have used jQuery .animate (Inspiration from how to get a div to randomly

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.