【发布时间】:2019-06-18 08:18:02
【问题描述】:
如果 x 和 y 坐标已知,是否可以缩放到某个点?
我有一个图像和该图像中的一个点,其坐标和坐标是已知的。这些坐标是动态的。意味着它可以相应地改变。在鼠标单击事件上我正在尝试缩放到该特定点。
对于缩放,下面的代码就足够了。感谢任何帮助或参考链接。
.image img {
-moz-transition: all 1s ease; /* Firefox */
-ms-transition: all 1s ease; /* IE 9 */
-o-transition: all 1s ease; /* Opera */
transition: all 1s ease;
}
.imgclickedtop{
-moz-transform:scale(3) !important; /* Firefox */
-ms-transform:scale(3) !important; /* IE 9 */
-o-transform:scale(3) !important; /* Opera */
transform:scale(3) !important;
}
【问题讨论】:
-
如果你使用transform-origin这是可能的
-
为此我们应该知道坐标的位置。对?我们怎么说坐标是在中心还是顶部还是左侧?
标签: html css transform zooming scale