Lot of divs? With CSS, I'm pretty sure it's not possible without a keyframe rule for each element. With JS, however:
window.onload = function() {
TweenLite.to(document.getElementsByClassName("box"), 1, {
top: 50,
left: 150,
onComplete: function() {
TweenLite.to(this.target, 0.2, {
opacity: 0,
onComplete: function() {
TweenLite.set(this.target, {
opacity: 1
});
this.restart();
}.bind(this)
});
}
});
};
body {
margin: 0px;
}
#container {
position: relative;
}
.wrapper {
/*position: relative;*/
width: 100px;
height: 100px;
border: 1px solid black;
}
.meet {
position: absolute;
top: 50px;
left: 150px;
width: 100px;
height: 100px;
border: 1px solid black;
}
.box {
position: absolute;
width: 100px;
height: 100px;
background-color: coral;
}
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/plugins/CSSPlugin.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenLite.min.js"></script>
<div id="container">
<div class="wrapper">
<div class="box"></div>
</div>
<div class="wrapper">
<div class="box"></div>
</div>
<div class="meet"></div>
</div>