Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
  
  <style>
    #animationdivTest { 
       animation: animatedBackground 20s linear infinite;
       -ms-animation: animatedBackground 20s linear infinite;
       -moz-animation: animatedBackground 20s linear infinite;
       -webkit-animation: animatedBackground 20s linear infinite;
    }
    
    .cssanimation #animationdiv { 
       animation: animatedBackground 20s linear infinite;
       -ms-animation: animatedBackground 20s linear infinite;
       -moz-animation: animatedBackground 20s linear infinite;
       -webkit-animation: animatedBackground 20s linear infinite;
      
      border:2px solid green;
    }
    
   /* just for demo */
    #animationdiv { padding:1em; border:1px solid #ccc;}
     #animationdivTest { position:absolute; left:-999px; top:-999px; }
    
    
         
  </style>
<body>
  
  <div id="animationdiv">I am the test div</div>
  <div id="animationdivTest">I am anim div</div>
<script>
  
  var el = document.getElementById('animationdiv');
  
  if( el.style['-webkit-animation'] !== undefined ) { 
    alert("okay"); 
     document.getElementsByTagName("html")[0].className +=' cssanimation';
  } 
  
 </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers