<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-80">
<title>welcome my web site</title>
<style>
*{
margin: 0;
padding: 0;
}
.box{
/*相对定位*/
position: relative;
display: flex;
width: 500px;
height: 500px;
border: 2px solid red;
}
.box div{
/*过度动画*/
transition: all 1s;
/*绝对定位*/
position: absolute;
top: 100px;
width: 200px;
height: 300px;
/*设置圆角*/
border-radius: 20px;
/*加阴影*/
box-shadow: 2px 2px 15px rgba(0,0,0, .2);
}
.left{
z-index: 0;
left: 0px;
/*缩放*/
transform: scale(0.8);
}
.center{
left: 150px;
z-index: 2;
}
.right{
z-index: 0;
left: 300px;
transform: scale(0.8);
}
</style>
</head>
<body>
<div class="box">
<div class="left" style="background:red;"></div>
<div class="center" style="background:blue;"></div>
<div class="right" style="background:green;"></div>
</div>
<script>
setinterval(()=>{
let left = document.queryselector('.left')
let center = document.queryselector('.center')
let right = document.queryselector('.right')
left.classname = 'center'
center.classname = 'right'
right.classname = 'left'
},1000)
</script>
</body>
</html>
上述代码本人练习作品,小白拿过去研究研究,大佬请绕走!
![图片[1]-3D旋转卡片|js入门案例-[:ug]Waris[:zh]Waris[:]](https://www.waric.cn/wp-content/uploads/2023/12/image-4.png)
版权声明
1 本网站名称:Waris 资源库
2 本站永久网址:https://www.waric.cn
3 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长微信Uyweb_cn,进行删除处理。
4 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
5 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6 本站部分资源存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
7 本站付费资源只收资源价格,售后另收费用,远程协助一般50¥起步!
© 版权声明
本站致力于为软件爱好者提供国内外软件开发技术和软件共享,着力为用户提供优资资源。
本站提供的所有下载文件均为网络共享资源,请于下载后的24小时内删除。如需体验更多乐趣,还请支持正版。
我站提供用户下载的所有内容均转自互联网,如有内容侵犯您的版权或其他利益的,请编辑邮件并加以说明发送到站长邮箱,站长会进行审查之后,情况属实的会在三个工作日内为您删除。
邮箱:2359736355@qq.com
THE END
暂无评论内容