jsbin
Я имитировать обеспечивают анимацию без JQuery. Ключ для достижения этого, который использует родительский & chidl отношение и понять ключевой момент, когда анимация играет.
.hover{
position: relative;
width: 200px;
height: 200px;
background-color: #1cf;
}
.background{
position: absolute;
width: 100%;
height: 100%;
color: #fff;
text-align: center;
line-height:10;
background-color: #c33;
transition: all 0.3s;
z-index: 2;
font-size: 20px;
}
.content{
position: absolute;
width: 100%;
height: 100%;
background-color: #fff;
text-align: center;
font-size: 20px;
opacity: 0;
line-height: 10;
transform: scale(-1,1);
transition: all 0.3s;
}
.hover:hover .background{
transform: scale(-1,1);
opacity: 0;
}
.hover:hover .content{
transform: scale(1,1);
opacity: 1;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="hover">
<div class="background">
This is background!!!
</div>
<div class="content">
This is content!
</div>
</div>
</body>
</html>
Если вы не хотите использовать 'jQuery', не пометить его – Downgoat
@ vihan1086 удалить тег – droidev
Причина заключается в том, что может быть смущает некоторых людей – Downgoat