35
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.

[ブラウザ] 強制的にリフローとリペイントを発生させる方法

Last updated at Posted at 2014-06-02

リフローを発生させる

要素のサイズを取得すればいいっぽい

function reflow(elem){
    console.log(elem.offsetHeight);
}

リペイントを発生させる

一回非表示にして再表示すればいいっぽい

$(elem).hide().show();

※overflowで隠れた要素(Youtube)をtranslateで動かして見える場所に移動させてもYoutube部分が描画されなかったので、その対処としてリペイントを発生させたらいけた。

35
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
35
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?