javascript或jquery怎么做出让图片以中心为基点放大缩小? 或者思路怎么做? 获取图片

2025-05-21 16:31:30
推荐回答(1个)
回答1:

有种思路是用css3,比如下面例子鼠标放上图片容器li ,里面的图片放大到150%

li img{
width: 100%;
-webkit-transform: scaleY(1); -moz-transform: scaleY(1); -o-transform: scaleY(1); -ms-transform: scaleY(1); transform: scaleY(1); -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; -ms-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;

}
li:hover img {-webkit-transform: scale(1.5); -moz-transform: scale(1.5); -o-transform: scale(1.5); -ms-transform: scale(1.5); transform: scale(1.5); 
}