Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<title>JS Bin</title>
</head>
<body>
  <div class="green"></div>
<div class="red">Click me</div>
</body>
</html>
 
div.green {
    width: 100px;
    height: 80px;
    background: green;
    border: 1px solid black;
    position: relative;
  }
  div.red {
    margin-top: 10px;
    width: 50px;
    height: 30px;
    background: red;
    border:  1px solid black;
    font-size:5px 
  position: relative;
  }
  .ui-effects-transfer {
    border: 1px dotted black;
    background: trasparent;
  }
 
$( "div" ).click(function() {
  var html1 = $(this).clone();  
  var i = 1 - $( "div" ).index( this );
  $( this ).effect( "transfer", { to: $( "div" ).eq( i ) }, 1000 ).promise().done(function(){
    $( "div" ).eq( i ).html(html1.html());
    $(this).empty();
  });
  
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers