记录鼠标跟随效果

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <meta charset="utf-8" />
    <style type="text/css">
        body{   margin: 0;
                font-size: 16px;
                font-family: Roboto;
                overflow-x: hidden;
                background-color: #1a1a1a;
                color: #fff;width:100%;
                height: 1000px;
                cursor: url('js/point.png'),default!important;
            }
        .mouse-follower{                
            position: fixed;
            top: 0;
            left: 0;
            width: 0;
            height: 0;
            z-index: 9999;
            pointer-events: none;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            mix-blend-mode: multiply;
            -webkit-transform: translate(-50%,-50%);
            -ms-transform: translate(-50%,-50%);
            transform: translate(-50%,-50%);
            -webkit-transition: top .15s ease-out,left .15s ease-out;
            -o-transition: top .15s ease-out,left .15s ease-out;
            transition: top .15s ease-out,left .15s ease-out;
    }
        .inner-mouse{
            width: 35px;
            height: 35px;
            -webkit-transform: translate(-50%, -50%);
            -ms-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
            background: #ff45454f;
            border-radius: 50%;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            opacity: 1;
            -webkit-transition: opacity 0.5s;
            -o-transition: opacity 0.5s;
            transition: opacity 0.5s;
            -webkit-box-shadow: 1px 3px 5px #d457578c;
            box-shadow: 1px 3px 5px #d457578c;
            -webkit-transition: background 0.5s, -webkit-box-shadow 0.5s;
            transition: background 0.5s, -webkit-box-shadow 0.5s;
            -o-transition: background 0.5s, box-shadow 0.5s;
            transition: background 0.5s, box-shadow 0.5s;
            transition: background 0.5s, box-shadow 0.5s, -webkit-box-shadow 0.5s;
        }
    </style>
    <script src="js/jquery.js"></script>
   
    <script>
        $(function () {。
            $(document).mousemove(function(e)   {
                $(".mouse-follower").css({ "position": "absolute", "left": e.pageX , "top": e.pageY });
            });  
        });
    </script>
</head>
<body>
    <div>
        <div class="mouse-follower">
            <div class="inner-mouse"></div>
        </div>
    </div>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值