Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
</head>
<body>
  <style>
    .animate {
      animation-duration: 2s;
      animation-iteration-count: infinite;
      animation-name: move-animation;
    }
  </style>
  
  <div class="animate">moving? (in body)</div>
  
  <div id="animator">
    <div>moving? (distributed)</div>
  </div>
  <script>
    document.getElementById('animator').attachShadow({mode: 'open'}).innerHTML = `
<style>
  div, ::slotted(*) {
    position: relative;
    left: 0;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-name: move-animation;
  }
  @keyframes move-animation {
    50% { left: 200px; }
  }
</style>
<slot></slot>
<div>moving? (in shadowRoot)</div>
`;
  </script>
  
</body>
</html>
Output

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

Dismiss x
public
Bin info
valdrinkoshipro
0viewers