Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <style>
    #element {
      background-color: yellow;
      opacity: 0;
    }
    #element.animateMe {
      animation: Fade 3s linear 1s forwards;
    }
    .spacer {
      height: 100vh;
    }
    @keyframes Fade {
      0% {opacity: 0;}
      25% {opacity: 0.25;}
      50% {opacity: 0.5;}
      75% {opacity: 0.75;}
      100% {opacity: 1;}
    }
</head>
<body>
    <div class="spacer"></div>
    <div id="element">I am an element, man</div>
<script>
  $(function () {
    var element = $("#element");
    $(window).scroll(function () {
      if($(window).scrollTop() > 0) {
        element.addClass("animateMe");
      }
      
    });
  });
</script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers