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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值