問題描述
這是我正在進行的項目(代碼完全復制,除了名稱更改等)
Here is the project I'm working on (code copied exactly except for names changed, etc.)
https://c9.io/schwigri/strange-crash/workspace/index.html
div #logo
的樣式如下:
The div #logo
has the style:
#logo {
-webkit-transition: .4s;
-moz-transition: .4s;
-o-transition: .4s;
transition: .4s;
}
這會導致 OS X 10.8.5 上的 Safari 6.0.5 立即崩潰.如果我刪除這些轉換,它不會崩潰.
This causes an immediate crash in Safari 6.0.5 on OS X 10.8.5. If I remove these transitions it doesn't crash.
我該如何解決這個問題?
How can I resolve this issue?
推薦答案
Safari 有時會在 all
-屬性轉換方面遇到一些問題.
Safari has some trouble sometimes with all
-property transitions.
試試這個:
#logo {
-webkit-transition: color .4s;
-moz-transition: .4s;
-o-transition: .4s;
transition: .4s;
}
玩了一會兒,其實是你使用 -webkit-transition: all
和 -webkit-calc()
導致問題.這是 Safari 中的一個錯誤,為了克服它,您可能需要使用 javascript 來計算您的上邊距而不是 CSS.
After playing around with it some more, it's actually the combination of your usage of -webkit-transition: all
and -webkit-calc()
that's causing the problem. This is a bug in Safari, and in order to overcome it, you may need to use javascript to calculate your top margin instead of CSS.
希望這會有所幫助!
這篇關于CSS3 過渡(供應商前綴)立即使 Safari 崩潰的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!