鼠标移上去,使其偏移效果

 var a = n.pageX / 80,
                s = n.pageY / 280;
            $(".home-container .role-1").css({
                transform: "translate3d(" + a + "px, " + s + "px, 0px)",
                "-webkit-transform": "translate3d(" + a + "px, " + s + "px, 0px)",
                "-moz-transform": "translate3d(" + a + "px, " + s + "px, 0px)",
                "-o-transform": "translate3d(" + a + "px, " + s + "px, 0px)"
            });

代码如上,待有空时做个DOME挂上去

posted @ 2018-07-09 09:23  1024记忆  阅读(341)  评论(0编辑  收藏  举报