<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
div{
position: absolute;
top: 0px;
left: 0px;
}
#box{
width: 200px;
height: 200px;
background: red;
}
#conn{
width:20px;
height: 20px;
background: green;
}
</style>
</head>
<body>
<div id="box"></div>
<div id="conn"></div>
<script type="text/javascript" src="js/TweenMax.min.js" ></script>
<script>
var t = new TimelineMax();
t.staggerTo('#conn',5,{
cycle: {
bezier: function(){
return [
{
x: 0,
y: 0
},{
x: 100,
y: 100,
},{
x: 200,
y: 200,
},{
x:400,
y: 0
},{
x: 600,
y: 200,
}]
}
}
})
</script>
</body>
</html>