HTML旋转照片盒子

效果图

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>旋转小方块</title>
        <link rel="stylesheet" href="css.css">
</head>
<body>
        <div class="wrapper">
                <div class="item1"></div>
                <div class="move1"><img src="img/1.png" alt=""></div>
                <div class="item2"></div>
                <div class="move2"><img src="img/2.png" alt=""></div>
                <div class="item3"></div>
                <div class="move3"><img src="img/3.png" alt=""></div>
                <div class="item4"></div>
                <div class="move4"><img src="img/4.png" alt=""></div>
                <div class="item5"></div>
                <div class="move5"><img src="img/5.png" alt=""></div>
                <div class="item6"></div>
                <div class="move6"><img src="img/6.png" alt=""></div>
        </div>
        <script>
                var wra = document.getElementsByClassName('wrapper')[0];
                var move1 = document.getElementsByClassName('move1')[0];
                var move2 = document.getElementsByClassName('move2')[0];
                var move3 = document.getElementsByClassName('move3')[0];
                var move4 = document.getElementsByClassName('move4')[0];
                var move5 = document.getElementsByClassName('move5')[0];
                var move6 = document.getElementsByClassName('move6')[0];
                console.log(move5);
                var key = true;
                wra.onmouseenter = function(e){
                        // wra.style.animationPlayState = 'paused';
                        move1.style.animation = 'move1 2s linear infinite';
                        move2.style.animation = 'move2 2s linear infinite';
                        move3.style.animation = 'move3 2s linear infinite';
                        move4.style.animation = 'move4 2s linear infinite';
                        move5.style.animation = 'move5 2s linear infinite';
                        move6.style.animation = 'move6 2s linear infinite';
                  
                }
                wra.onmouseleave = function(e){
                        // wra.style.animationPlayState = 'paused';
                        move1.style.animation = '';
                        move2.style.animation = '';
                        move3.style.animation = '';
                        move4.style.animation = '';
                        move5.style.animation = '';
                        move6.style.animation = '';
                }
        </script>
</body>
</html>

CSS样式代码私聊有偿获取昂

相关推荐
WEI_Gaot11 分钟前
react19 的项目创建和组件使用
前端·react.js
资深前端外卖员14 分钟前
【nodejs高可用】前端APM应用监控方案 + 落地
前端·后端
OhBonsai15 分钟前
Shader 图像处理1_ToneMap技术处理过曝
前端
突头小恐龙15 分钟前
Chrome devTools - Lighthouse
前端·javascript·chrome
谦谦橘子15 分钟前
手写tiny webpack,理解webpack原理
前端·javascript·webpack
土豆125017 分钟前
Tailwind CSS 精通指南:提升效率、可维护性与最佳实践
前端·css
花生了什么树lll17 分钟前
面试中被问到过的前端八股(四)
前端·面试
zqlcoding17 分钟前
使用el-table表格动态渲染表头数据之后,导致设置fixed的列渲染出现问题
前端·javascript·vue.js
爱吃的强哥29 分钟前
vue3 使用 vite 管理多个项目,实现各子项目独立运行,独立打包
前端·javascript·vue.js
谈不譚网安38 分钟前
CSRF请求伪造
前端·网络安全·csrf