如何在没有动画的情况下使用 jquery 转换?
How can I use jquery transform without animation?
我尝试将元素的比例从 1 更改为 0,8。
这很好用:
$(this).find(".overlay").css('transform', 'scale(0.8)')
唯一的问题是,转换是用动画实现的。没有动画怎么办?
在使用变换之前将过渡设置为 none:
$el = $(this).find('.overlay');
$el.css('transition', 'none');
$el.css('transform','scale(0.8)');
如果 css 正在添加动画,您可以尝试添加 $(this).find(".overlay").css({ transform: "scale(0.8)", transition: "none" })
。
我尝试将元素的比例从 1 更改为 0,8。 这很好用:
$(this).find(".overlay").css('transform', 'scale(0.8)')
唯一的问题是,转换是用动画实现的。没有动画怎么办?
在使用变换之前将过渡设置为 none:
$el = $(this).find('.overlay');
$el.css('transition', 'none');
$el.css('transform','scale(0.8)');
如果 css 正在添加动画,您可以尝试添加 $(this).find(".overlay").css({ transform: "scale(0.8)", transition: "none" })
。