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>
  <div id="fixed-container">
    <div id="foo">
      <div class="a"></div>
      Some text
    </div>
  </div>
  
  <div id="element"></div>
  <div id="element2"></div>
</body>
</html>
 
#fixed-container {
  will-change: transform;
}
#foo {
  width: 100px;
  height: 100px;
  border: 2px solid black;
}
.a {
  position: fixed;
  top: 0;
  width: 50px;
  height: 50px;
  background: green;
}
#element, #element2 {
  position: fixed;
  right: 5px;
  top: 5px;
  width: 100px;
  height: 100px;
  background: -moz-element(#foo);
  border: 2px solid blue;
}
#element2 {
  top: 110px;
  background: -moz-element(#fixed-container);
}
Output

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

Dismiss x
public
Bin info
flackrpro
0viewers