※Please check using Developer tools
Dummy Text
.block {
display: flex;
max-width: 1200px;
width: 100%;
margin: 50px auto 0;
}
.text {
width: 40%;
margin: 100px 0 0;
text-align: center;
font-size: 20px;
}
.img {
position: relative;
display: flex;
width: 60%;
}
.img:after {
content: "";
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
transition: all .7s cubic-bezier(.90,-.025,.45,1) .8s;
background: #fff;
background-attachment: fixed;
z-index: 2;
}
.img-main {
background: url("/demo01/demo-curtain-11/a.jpg") no-repeat center;
background-size: cover;
}
.img-main {
position: relative;
width: 62%;
}
.img-sub {
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
z-index: 1;
transition: all .7s cubic-bezier(.80,-.05,.25,.99) 1.4s;
background: url("/demo01/demo-curtain-11/b.jpg") no-repeat center right;
background-size: cover;
}
.img-sub img,
.img-main img {
opacity: 0;
}
.active .img:after {
left: 100%;
}
.active .img-sub {
width: 38%;
}
@media screen and (max-width:640px){
.block {
flex-wrap: wrap;
max-width: 100%;
}
.text {
width: 100%;
margin: 30px 0 0;
order: 2;
}
.img {
width: 100%;
order: 1;
}
}
$(window).on('load', function(){
$(".block").addClass("active");
});