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>
  <script src="http://snapsvg.io/assets/js/snap.svg-min.js"></script>
  <script src="http://snapsvg.io/assets/js/prism.js"></script>
</head>
<body>
  <div id="svg" width="400" height="400"></div>
  
</body>
</html>
 
var s = Snap(400,400);
var bigCircle = s.circle(150, 150, 100);
var moveFunc = function (dx, dy, posx, posy) {
        this.attr( { cx: posx , cy: posy } );
};
bigCircle.drag( moveFunc,
                function(){
                    console.log("Move started");
                },
                function(){
                    console.log("Move stopped");
                }
        );
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers