jquey/css question

Below is the code, but I cannot seem to get the "down panel" to lineup beneath the "up panel".

Any help would be appreciated.

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script> 
$(document).ready(function(){
    $("#flip").click(function(){
        $("#panel").slideToggle("slow");
    });
});
</script>

<style> 
#panel, #flip {
    padding: 5px;
    text-align: center;
    background-color: #e5eecc;
    border: solid 1px #c3c3c3;
    width: 250px;
    float: right;
}

#panel {
    padding: 50px;
    display: none;
}
</style>
</head>
<body>
 
<div id="flip">Click to slide the panel down or up</div>
<div id="panel">Hello world!</div>

</body>
</html>

Open in new window

a204801Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom BeckCommented:
Nest the divs one inside the other.
<div id="flip">Click to slide the panel down or up
   <div id="panel">Hello world!</div>
</div>

Open in new window

Change the padding on #panel to padding: 50px 0.
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
http://jsbin.com/tinagi/edit?html,output

Wrap the 2 divs in a container div.  Give the container div the width and float after removing it from the  #panel, #flip

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script> 
$(document).ready(function(){
    $("#flip").click(function(){
        $("#panel").slideToggle("slow");
    });
});
</script>

<style> 
  .container{
     width: 250px;
    float: right;
  }
#panel, #flip {
    padding: 5px;
    text-align: center;
    background-color: #e5eecc;
    border: solid 1px #c3c3c3;
  /*
    width: 250px;
    float: right;
  */
}

#panel {
    padding: 50px;
    display: none;
}
</style>
</head>
<body>

<div class="container">
<div id="flip">Click to slide the panel down or up</div>
<div id="panel">Hello world!</div>
  </div>
</body>
</html>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
a204801Author Commented:
Scott,  Thank you.  What I needed.

Just have one follow up CSS question.

In the code below, I want the "up panel" to have the bottom rounded corners, and then when it expands the round corners to stay at the bottom and "slide down".  Does that make sense?  I have added some of the CSS, but cannot get it to function correctly.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script> 
$(document).ready(function(){
    $("#flip").click(function(){
        $("#panel").slideToggle("slow");
    });
});
</script>

<style> 
  .container-cta{
     width: 250px;
    float: right;
  }
.main-cta{
height: 25px;
}
#panel, #flip {
    padding: 5px;
    text-align: center;
width: 400px;
-webkit-border-radius: 0px 0px 60px 60px;
-moz-border-radius: 0px 0px 60px 60px;
border-radius: 0px 0px 60px 60px;
background-color:#E3A20B;
}

#panel {
 padding: 5px;
    display: none;
width: 400px;
-webkit-border-radius: 0px 0px 60px 60px;
-moz-border-radius: 0px 0px 60px 60px;
border-radius: 0px 0px 60px 60px;
background-color:#E3A20B;
}
</style>
<div class="container-cta">
<div id="flip">Click to slide the panel down or up</div>
<div id="panel">Hello world!</div>
  </div>

Open in new window

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Let's not let this question creep, I think what you want now is a progression and a new question.

Essentially you only want panel to be taller and start above the flip.  But put this part into a new question.
a204801Author Commented:
Fair enough.  Will create a new one.  Wasn't trying to let it creep.  I guess that was my original intention, thought I was closer than I was.
a204801Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.