Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</body>
</html>
 
var $a = $("<div>").css({
  backgroundColor: "red",
  height: 100,
  width: 100
}).appendTo($("body"));
$("<div>").hide().css({
  backgroundColor: "green",
  height: 50,
  width: 50
}).appendTo($("body")).toggle({
  duration: "slow",
  effect: "fade"
}).position({
  my: "right top",
  at: "right bottom",
  of: $a
});
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers