banner鼠标交互动画

//banner鼠标交互动画
    $(".layerTransform").on("mousemove", function(e){
        var _this = $(this);
        var x = e.pageX;
        var y = e.pageY;
        //console.log(x);
 var w = _this.width();  var h = _this.height();  //console.log(w + "|" + h);  var moveX = (x / w - .5) * -25 || 10,  moveY = -(y / h - .5) * -20 || 10;  _this.find(".layerTransformInner").css({"transform":"rotateX("+ moveY +"deg) rotateY("+ moveX +"deg)"});  });

转载于:https://www.cnblogs.com/hlyin/p/6823392.html

你可能感兴趣的:(banner鼠标交互动画)