Last active
March 21, 2017 02:21
-
-
Save martianyi/2971c2b5b6b8d213a3d3 to your computer and use it in GitHub Desktop.
simple loader
This file contains hidden or 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
var flag = false; | |
var timer = null; | |
window.addEventListener('load', function () { | |
if (!flag) { | |
flag = true; | |
document.getElementById("load").style["display"] = "none"; | |
clearTimeout(timer); | |
} | |
}, false); | |
timer = setTimeout(function () { | |
if (!flag) { | |
flag = true; | |
document.getElementById("load").style["display"] = "none"; | |
} | |
}, 5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment