Css 单击从一个div到另一个div时创建幻灯片过渡
如何使用CSS进行此转换 我在做类似的事情Css 单击从一个div到另一个div时创建幻灯片过渡,css,css-transitions,Css,Css Transitions,如何使用CSS进行此转换 我在做类似的事情 如何使用上述功能进行输入输出请帮助使用转换计时功能 #container { width: 400px; position: relative; } #div1, #div2 { width: 200px; height:200px; float: left; background-color: red; } #div2 { position: absolute; width: 200px; height:200p
如何使用上述功能进行输入输出请帮助使用转换计时功能
#container {
width: 400px;
position: relative;
}
#div1, #div2 {
width: 200px;
height:200px;
float: left;
background-color: red;
}
#div2 {
position: absolute;
width: 200px;
height:200px;
float: left;
background-color: blue;
}
.show {
-o-transition: opacity 3s;
-moz-transition: opacity 3s;
-webkit-transition: opacity 3s;
transition: opacity 3s;
opacity:1;
/* This timing applies on the way OUT */
transition-timing-function: ease-in;
/* Hide thing by pushing it outside by default */
transform: translateX(100%);
}
.hide{
opacity:0;
/* This timing applies on the way IN */
transition-timing-function: ease-out;
/* A litttttle slower on the way in */
transition: 1.25s;
/* Move into place */
transform: translateX(0%);
}
您可以使用过渡计时功能:轻松进入;Codepen:@Yasir非常感谢我们如何从右向左翻译
#container {
width: 400px;
position: relative;
}
#div1, #div2 {
width: 200px;
height:200px;
float: left;
background-color: red;
}
#div2 {
position: absolute;
width: 200px;
height:200px;
float: left;
background-color: blue;
}
.show {
-o-transition: opacity 3s;
-moz-transition: opacity 3s;
-webkit-transition: opacity 3s;
transition: opacity 3s;
opacity:1;
/* This timing applies on the way OUT */
transition-timing-function: ease-in;
/* Hide thing by pushing it outside by default */
transform: translateX(100%);
}
.hide{
opacity:0;
/* This timing applies on the way IN */
transition-timing-function: ease-out;
/* A litttttle slower on the way in */
transition: 1.25s;
/* Move into place */
transform: translateX(0%);
}