Check out this fiddle for a demonstration: http://jsfiddle.net/100pvu95/19/
The sidebar's position is set to relative by default. When the toggle button is clicked, the sidebar animates to -55%, keeping part of it visible. Clicking the toggle button again returns the sidebar to its initial state through if/else conditions and two animations:
HTML:
<div id="sidebar">
SIDEBAR
<button id="toggle">Toggle</button>
</div>
CSS:
$(document).ready(function () {
$("#toggle").on('click', function () {
var x = $("#sidebar").css("left");
if(x == '0px') {
$("#sidebar").animate({
left: '-55%'
});
} else {
$("#sidebar").animate({
left: '0'
});
}
});
});