Have a look at this code
HTML
<div id="container">
<div id="slidable"class="hide">Foobar</div>
<div id="side">+</div>
</div>
I have added a class
'hide' to div
with id="slidable" just to hide it when the page loads. If you don't want it, you may remove.
CSS (Only change is I have added hide
class)
#side{
float:right;
width:50px;
height:50px;
background:#BBB;
}
.hide{
display:none;
}
#slidable{
float:right;
height:50px;
background:#888;
width:200px;
}
JQuery
jQuery(document).ready(function($) {
$( "#side" ).click(function() {
$('#slidable').animate({width: 'toggle'});
});
})