Created
October 17, 2015 10:51
-
-
Save desigens/7c8048f390b2cb21471c to your computer and use it in GitHub Desktop.
Async background image
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style type="text/css"> | |
body.a { | |
background: url(http://ololo.com/i.png) no-repeat; | |
} | |
</style> | |
</head> | |
<body onload="end()" id="body"> | |
<div id="a">null1</div> | |
<script type="text/javascript"> | |
Date.now = Date.now || function() { return +new Date; }; | |
var t = Date.now(); | |
var out = document.getElementById('a') | |
// console.time(1); | |
function end () { | |
// console.timeEnd(1); | |
out.innerHTML = (Date.now() - t); | |
} | |
setTimeout(function () { | |
document.getElementById('body').className = 'a'; | |
}, 0); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment