Created
August 25, 2016 08:34
-
-
Save SubZane/5c84496440bf63b08faec1c3fa1b2dd4 to your computer and use it in GitHub Desktop.
Force the repaint of an element. Sometimes necessary when adding CSS rules after document loaded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Force the repaint of an element. Sometimes necessary when adding CSS rules after document loaded. | |
function forceRepaint(element) { | |
element.style.display='none'; | |
var temp = element.offsetHeight; | |
element.style.display=''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment