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

 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挂上去

猜你喜欢

转载自www.cnblogs.com/wm218/p/9282206.html