Edit: The immediate reaction to my code below will be to not use the div#removeme and provide a margin-bottom instead. However, if you are going with position:fixed , this will not work, since it is attached to the window, not to the document.
This is what I do:
In my html document:
<div id="removeme"> <br /><br /> </div> <div id="header"> This is a floating pane! </div> <div id="content"> Your content goes here... </div>
CSS for this floating panel:
#header { position: fixed; top: 0px; left: 0px; text-align: center; background-color: #FFE6BF; height: 30px; border: 1px solid #FFCFA6; width: 100%; }
And then use jquery in the <head> :
$(document).ready(function() { $('#header').click(function() { $('#header').slideUp('fast'); $('#removeme').remove(); }); });
I have an extra <div> with id removeme to push the content down when the floating panel is visible, and I delete it whenever the floating panel is hidden.
Shripad krishna
source share