36
35

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CSSでfixedなどを使った時、ページスクロールがガタガタするときの対応

Last updated at Posted at 2015-05-28

よく忘れるのでメモ。

CSS TransformsでCSS Animation/Transitionと組み合わせて、要素を移動させたり、拡大縮小させるとちらつくことがあるらしい。
ちらつく現象はiOSのSafariの専売特許ではなく、PCやスマホに関係なく発生するらしい。

position: fixed;を指定したスタイルに以下を追加する。

  -webkit-backface-visibility:hidden;
  backface-visibility:hidden;

それでも解消されない場合は、

  -webkit-backface-visibility:hidden;
  backface-visibility:hidden;
  overflow:hidden

ちなみに、backface-visibilityは全てのブラウザには対応していない。
https://developer.mozilla.org/ja/docs/Web/CSS/backface-visibility

36
35
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
36
35

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?