css
.transformBox{
transform-style: preserve-3d;
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
}
html
<div class="col-lg-4 transformBox">
<div style="transform: translateZ(100px);">
<img src="images/bannerPic.png" />
</div>
</div>
js
$(‘.transformBox‘).mousemove(function (e) {
var xx = e.pageY/100;
var yy = e.pageX/100;
$(this).find(‘.aa‘).css({
"transform": "rotateX(" +xx+"deg) rotateY("+yy+"deg)"
//"transform":(+y)+"px"
});
});
时间: 2024-11-05 18:54:29