Created
May 26, 2012 01:11
-
-
Save igrigorik/2791589 to your computer and use it in GitHub Desktop.
testing media queries + browser fetch behavior
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
body { | |
color: red; | |
} | |
#image { | |
width:200px; | |
height:100px; | |
background: gray; | |
background-image:url('http://localhost:9000/file0.css?delay=3'); | |
} | |
@media only screen and (max-width: 680px) and (min-width: 0px) { | |
#image { | |
background: hotpink; | |
background-image: url('http://origin.igvita.com/images/ilya.jpg'); | |
} | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
function onOload() { | |
console.log('window onload'); | |
} | |
function callback(msg) { | |
console.log(msg); | |
} | |
if (window.addEventListener) | |
window.addEventListener("load", onOload, false); | |
else if (window.attachEvent) | |
window.attachEvent("onload", onOload); | |
else window.onload = onOload; | |
</script> | |
<link type="text/css" rel="stylesheet" href="responsive.css" /> | |
<script src="http://localhost:9000/file3.js?delay=2" async onload="callback(3)"></script> | |
<script src="http://localhost:9000/file4.js?delay=1" async onload="callback(4)"></script> | |
</head> | |
<body> | |
Hello World!<hr /> | |
<!-- consistent behavior across all browsers: images are fetched only when needed --> | |
<div id="image"> </div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment