Q:

Always up header and sliding div

Suppose to have an header which is always visible (i.e. also when page is scrolled down). 
<div id="header">
    <div id="logindiv">
        Something to show for login purpose
    </div>
    My title etc.
</div>
<div id="pagecontent">
    page content and also a <button id="btn">Button</button>
</div>

The CSS is something similar:
 #logindiv{
    width: 100%;  
    display:none;
 }
 #header{
    display:block;
    z-index: 1000;
    height:50px;
    position: fixed;
    top: 0;
    width: 100%  
 }
 #pagecontent{
    z-index: 0;
    margin-top:50px;
    width: 100%  
 }

The div logindiv is shown with jQuery when on click on such a button: a slideDown() function is used for cosmetic purpose. 
How can I also slide-down the pagecontent div by the same height of logindiv?
Of course, I also have to reset everything after the slide-up of the hidden div. 
See my working JSFiddle.
Moreover, see this site for an example of the desired output.

A:

I found a solution. Here you can find the JSFiddle. 
1) I added an empty div before the pagecontent.
<div id="header">
    <div id="logindiv">
        Someting to show for login purpose
    </div>
    My title etc.
</div>
<div id="forsliding"></div>
<div id="pagecontent">
    page content and also a <button id="btn">Button</button>
</div>

2) I modified the CSS by adding the CSS for the new div, that is equal to the CSS for the sliding div. Of course I had to set the height fixed.
 #logindiv, #forsliding{
    width: 100%;
    height:40px;   
    display:none;
 }

3) And I did a small change to the Javascript code.
$(function () {
   $('#btn').click(function(){
       var div =  $('#logindiv');
       if(div.is(':hidden'))
         div.add('#forsliding').slideDown();
       else
         div.add('#forsliding').slideUp();

    });
});

