How to make the all wrap after click left to right decrease the size become not visible? now I use width 0 for div and img but can't find the way make same effect on text, also if use opacity it will flash after finish
$('.wrap').click(function(){
$(this).find('img').animate({
width: '0'
});
$(this).find('.back').animate({
width: '0'
});
$(this).find('.text').animate({
opacity: '0'
});
});
<div class="wrap">
<div class="text"><div class="title">背後的故事</div></div>
<div class="back"><img src="../public/imgs/2/back.png"></div>
</div>
.text{
widht: 95px;
height: 760px;
position: absolute;
.title{
position: absolute;
-webkit-writing-mode: vertical-lr;
text-align: center;
line-height: 95px;
z-index: 1;
font-size: 17px;
}
}
.back{
position: absolute;
width: 97px;
height: 760px;
img{
position: absolute;
left: 50%;
top: 50%;
width: 90px;
height: 600px;
margin-left:-45px;
margin-top: -300px;
}
}