Random header images

This commit is contained in:
2016-01-13 14:53:15 +00:00
parent a37b2c1e06
commit 3a8ab74479
8 changed files with 63 additions and 15 deletions

View File

@@ -32,6 +32,11 @@
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.analytics }}']);
_gaq.push(['_trackPageview']);
window.onload = function() {
var headers = {{ site.headers | implode }};
var header = headers[Math.floor(Math.random() * headers.length)];
document.getElementById('masthead').style.backgroundImage = "url('/asset/header/" + header + ".jpg')";
}
</script>
</head>
<body class="layout-{{ page.layout }}{% if page.body_class %} {{ page.body_class }}{% endif %}">