the block continues to go but must crawl back. Should get a menu. and how to make it so that when you click on a void the block closes? and the background was darkened)
$('#pollSlider-button').click(function() { if($(this).css("margin-left") == "70%") { $('.pollSlider').animate({"margin-left": '-=70%'}); $('#pollSlider-button').animate({"margin-left": '-=70%'}); } else { $('.pollSlider').animate({"margin-left": '+=70%'}); $('#pollSlider-button').animate({"margin-left": '+=70%'}); } }); .pollSlider{ position:fixed; height:100%; background:red; width:70%; left:0px; margin-left: -70%; } #pollSlider-button{ position:fixed; width:100px; height:50px; left:0px; background:green; top:100px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="pollSlider"></div> <div id="pollSlider-button"></div>