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="char_furuta_head"></div>
</body>
</html>
 
var head = document.getElementById('char_furuta_head');
function anime() {
var direction = 1; /* 1 = down, -1 = up */
setInterval(frame, 1000);
function frame() {
    if (direction == 1) {
        var lel = head.style.top;
        lel += 2;
        console.log(lel);
        head.style.top = lel + '%';
        if(lel == 20) { direction = -1; };
    } else {
        var lel = head.style.top;
        lel -= 2;
        head.style.top = lel + '%';
        if(lel == 0) { direction = 1; }; 
    }
}
}
anime();
Output

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

Dismiss x
public
Bin info
dorwardpro
0viewers