LoginSignup
0
0

More than 5 years have passed since last update.

ブラウザの高さが取得できない瞬間

Last updated at Posted at 2016-11-01

特定の状況のときにブラウザの高さを適切に取得できない瞬間がある。
ちゃんとした原因は分からないが、下記の状態の時

.foo {
    position: fixed;
    top: 0; 
    transition: all 0.2s ease;
}

.foo要素をモーダルでアニメーションさせて表示させる際に、transitionがallだとresizeやorientationchangeイベントでブラウザの高さを取得したらぜんぜん違う高さが返ってきた。

transitionをallではなく変形させたいプロパティのみにしたら問題なく取得できたので、fixedとtransitionがallの時の組み合わせで起きていた模様。

mobile safari以外で試してないので他ブラウザでも同様に起きるのかは分からない。

※訂正:chromeではなくmobile safariでした

0
0
4

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
0
0