Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
       <!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script> 
$(document).ready(function(){
    var clicked;
    var c=0;
    $("button").click(function(){
        if(!clicked) {
            clicked = true;
            $("div").stop().animate({
                left: ++c%2*100 ,
                opacity: '0.5',
                height: '150px',
                width: '150px'
            },'fast');
        } else {
            clicked = false;
            $("div").stop().animate({
                left: '0',
                opacity: "1",
                width: "100px",
                height: "100px"
            }, 500);
        };
    });
});
</script> 
</head>
<body>
<div style="background:#98bf21;height:100px;width:100px;position:absolute;"><button>Start Animation</button></div>
</body>
</html>
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers