码迷,mamicode.com
首页 > 其他好文 > 详细

鼠标经过显示 动画

时间:2020-06-07 19:18:03      阅读:86      评论:0      收藏:0      [点我收藏+]

标签:height   port   nbsp   absolute   color   问题   UNC   back   set   

技术图片

 

 

 
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./animate.js"></script>
    <style>
        .sliberbar {
            position: fixed;
            right: 0;
            bottom: 100px;
            width: 40px;
            height: 40px;
            text-align: center;
            line-height: 40px;
            cursor: pointer;
            color: #fff;
        }
        
        .con {
            position: absolute;
            left: 0;
            top: 0;
            width: 200px;
            height: 40px;
            background-color: purple;
            z-index: -1;
        }
    </style>
</head>


<body>
    <div class="sliberbar">
        <span>←</span>
        <div class="con">问题反馈</div>
    </div>

    <script>
        var sliderbar = document.querySelector(‘.sliberbar‘);
        var con = document.querySelector(‘.con‘);
        sliderbar.addEventListener(‘mouseenter‘, function() {
            animate(con, -160, function() {
                sliderbar.children[0].innerHTML = ‘→‘;
            });
        })
        sliderbar.addEventListener(‘mouseleave‘, function() {
            animate(con, 0, function() {
                sliderbar.children[0].innerHTML = ‘←‘;
            });
        })
    </script>
</body>

</html>

鼠标经过显示 动画

标签:height   port   nbsp   absolute   color   问题   UNC   back   set   

原文地址:https://www.cnblogs.com/ericblog1992/p/13061556.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!