Hover 2
This hover resolves the problem of overlapping elements. It also transitions two states separately.
by Matthew Day
HTML
<div class="wrap">
<div class="subwrap">
<div class="trigger">
<div class="en">
<p>Devil Cat</p>
<p><em>noun</em></p>
<p>It is an animal that is capable of killing other larger animals by biting them in the throat.</p>
</div>
</div>
<div class="trigger">
<div class="sp">
<h4>El Gato Diablo</h4>
<p><em>sustantivo</em></p>
<p>Es un animal que es capaz de matar a otros animales más grandes al morderles en la garganta.</p>
</div>
</div>
</div>
</div>
CSS
*{
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Helvetica;
font-size: 14px;
font-weight: 100;
line-height: 1.5em;
color: white;
}
h4 {
text-transform: uppercase;
}
p {
padding: 4px 0 10px 0;
}
.wrap {
position: relative;
background-image: url("http://www.placekitten.com/g/300/300");
background-repeat: no repeat;
background-position: center center;
background-size: cover;
width: 300px;
height: 300px;
}
.subwrap {
width: 100%;
height: 100%;
transition: all .9s ease-in-out .3s;
}
.trigger {
float: left;
width: 50%;
height: 100%;
}
.en {
position: absolute;
top: 0;
left: -150px;
width: 150px;
padding: 30px 16px 0;
transition: all .9s ease-in-out;
}
.sp {
position: absolute;
top: 0;
right: -150px;
width: 150px;
padding: 30px 16px 0;
transition: all .9s ease-in-out;
}
.trigger:hover > .en {
left: 0;
}
.subwrap:hover {
background: rgba(0,0,0,.6);
}
.trigger:hover > .sp {
right: 0;
}