<div class="box box1"></div>
<div class="box box2"></div>
<div class="box box3"></div>
<div class="box box4"></div>
<div class="box box5"></div>
.box{display:inline-block; margin: 15px; width:100px; height:100px; background:#ccc;}
gsap.from(".box",{
duration:2, scale:0.5, opacity:0, ease:'elastic'
})
var tl = gsap.timeline({repeat: 1, repeatDelay: 1});
$(".box").on("click",function(){
for(var i=0; i<=$(".box").length; i++){
tl.to(".box"+i,{
duration: 0.5,
opacity:0,
y:-200,
ease:"back.in"
})
}
})
This Pen doesn't use any external CSS resources.