Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.0.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<div class="div"><h2>hi</h2></div>
  <button>click me</button>
  
</body>
</html>
 
    $("button").click(function(){
        $(".div").animate({
           left: "0px"
       }, 300);
        $("body").animate({
           left:"150px"
        }, 300);
    });
/*the below doesn't work
$("button").click(function(){
       $(".div").animate({
           left: "-150px"
       }, 300);
        $("body").animate({
           left:"0px"
        }, 300)
    }); */
Output

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

Dismiss x
public
Bin info
penhovapro
0viewers