Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <a href="#" id="showmenu">Click Here</a>
  <div class="menu">
    <ul>
      <li><a href="#">Button 1</a></li>
      <li><a href="#">Button 2</a></li>
      <li><a href="#">Button 3</a></li>
    </ul>
  </div>
</body>
</html>
 
var min = "-100px", // remember to set in css the same value
    max = "0px";
$(function() {
  $("#showmenu").click(function() {
  
    if($(".menu").css("marginLeft") == min)
      $(".menu").animate({ marginLeft: max });
    else
      $(".menu").animate({ marginLeft: min });
    
  });
  
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
balexandrepro
0viewers