Javascript 变换比例转换仅在Safari中不起作用?
好的,我看了类似的问题,但在我的例子中没有任何效果-我有一个转换比例/转换,它不仅仅在Safari中有效。缩放会发生,但会捕捉-无过渡。代码:Javascript 变换比例转换仅在Safari中不起作用?,javascript,jquery,html,css,sass,Javascript,Jquery,Html,Css,Sass,好的,我看了类似的问题,但在我的例子中没有任何效果-我有一个转换比例/转换,它不仅仅在Safari中有效。缩放会发生,但会捕捉-无过渡。代码: .site-title a { img { -webkit-transition-timing-function: cubic-bezier(0, 1.4, 1, 1) 0s; -o-transition-timing-function: cubic-bezier(0, 1.4, 1, 1) 0s; -moz-transiti
.site-title a {
img {
-webkit-transition-timing-function: cubic-bezier(0, 1.4, 1, 1) 0s;
-o-transition-timing-function: cubic-bezier(0, 1.4, 1, 1) 0s;
-moz-transition-timing-function: cubic-bezier(0, 1.4, 1, 1) 0s;
transition-timing-function: cubic-bezier(0, 1.4, 1, 1) 0s;
transition-duration: 300ms;
}
}
.site-title a:hover {
img {
transform: scale(1.03);
content: url("https://firebasestorage.googleapis.com/v0/b/file-hosting-723cd.appspot.com/o/Asset%201.png?alt=media&token=07551984-08b6-4c8e-99b4-69280e148aa2")
}
}
.site-title a:selected {
img {
transform: scale(1.03);
content: url("https://firebasestorage.googleapis.com/v0/b/file-hosting-723cd.appspot.com/o/Asset%201.png?alt=media&token=07551984-08b6-4c8e-99b4-69280e148aa2")
}
}
我添加了各种过渡,但Safari删除了一些。这里怎么了 您可以使用此代码
img {
-webkit-transform: translateZ(0);
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
img:hover {
-webkit-transform: scale(1.2);
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
似乎您从未指定转换属性,仅指定持续时间和计时函数,因此我不确定它在任何浏览器中如何工作。如果您添加了它,但它仍然不起作用,那么一个堆栈片段让人们可以在Safari中进行实际测试将是非常棒的。共享一个工作示例…我们将很容易解决这个问题…content CSS属性与::before和::after伪元素一起使用,以生成元素中的内容。