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样式代码私聊有偿获取昂

相关推荐
kyriewen2 分钟前
我受够了复制报错去问 AI,花一下午给控制台做了个调试助手
前端·javascript·ai编程
IT_陈寒1 小时前
Redis的DEL命令竟然没删掉数据?我踩的这个坑你得知道
前端·人工智能·后端
anOnion1 小时前
构建无障碍组件之Menu and Menubar Pattern
前端·html·交互设计
JavaGuide1 小时前
我用 Claude Code/ZCode+GLM-5.3 从零做了一款 Agent 游戏!
前端·后端
Eason_Lou1 小时前
vue flow使用注意事项
前端·vue.js
小赵同学WoW2 小时前
1-2 TypeScript 中的 `any` 与 `unknown`
前端
six_2 小时前
C# 上位机(持续更新中)
前端·面试·c#
风雨_2 小时前
Git Worktree sourcetree完整使用指南
前端
半个落月3 小时前
React 组件通信进阶:useContext 与自定义 Hook 实战详解
前端·react.js
用户921080262863 小时前
ChatComposer 输入区改造:基于技能市场实现 Agent 输入框
前端