[前端css-3] 实现图片卷帘效果,以及动画
1.效果展示:
效果预览
2.知识点:
1.position(相对定位/绝对定位)
2.伪类(:after/:before)
3.animation(动画)
3.源代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>层叠图片拖动卷帘式动画特效原图细节对比原生js插件</title>
<meta name="keywords" content="层叠图片,拖动,卷帘式,动画特效,原图细节对比,原生js插件">
<meta name="description"
content="层叠图片拖动卷帘式动画特效原图细节对比原生js插件代码下载。一款很实用的jQuery图片插件,它可以帮助你实现原图和经过处理的图片进行对比,拖动中间的分割线来进行两张图片的细节对比。">
<style>
#page {
width: 100%;
height: 100%;
position: absolute;
}
* {
margin: 0;
box-sizing: border-box;
}
.wrapper {
width: 900px;
height: 600px;
position: absolute;
left: 50%;
top: 50%;
transform: translate3d(-50%, -50%, 0);
overflow: hidden;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}
.before,
.after {
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-color: white;
background-size: cover