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

相关推荐
fruge20 分钟前
前端简历优化:如何突出项目亮点与技术深度(附示例)
前端
华仔啊23 分钟前
Vue3 + Element Plus 动态菜单实现:一套代码完美适配多角色权限系统
前端·vue.js
n***840728 分钟前
Springboot-配置文件中敏感信息的加密:三种加密保护方法比较
android·前端·后端
姜太公钓鲸23337 分钟前
Bootstrap是什么?作用是什么?使用场景是什么?如何使用?
前端·bootstrap·html
Aerelin43 分钟前
爬虫playwright中的等待机制
前端·爬虫·python
慧慧吖@1 小时前
关于在本地去模拟生产环境检测页面内容注意事项
前端·javascript·vue.js
码农很忙1 小时前
用SpreadJS实现分权限管理:前端技术栈的精准控制实践
前端
黄团团1 小时前
Vue2整合Electron开发桌面级应用以及打包发布(提供Gitee源码)
前端·javascript·vue.js·elementui·electron
勇气要爆发1 小时前
问:LocalStorage、Vuex、Pinia的区别和本质
前端
Aerelin1 小时前
iframe讲解(爬虫playwright的特殊应用)
前端·爬虫·python·html