Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 547 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 547 Bytes

Unflickering

Usually you have to wait until the page loads to change something on it. However, in that case the user will see the old version of the page until before it is changed. It is called flickering.

To avoid flickering, you can hide the page before it started to render.

var html = document.getElementsByTagName('html')[0];
html.style.visibility = 'hidden';

After your experiment did all the transformation, you can show the page.

html.style.visibility = '';

The users will never see the old version of the page.