鼠标移上去,使其偏移效果
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挂上去