When I open a page I want to get full-height background image. Like this
I haven't started using jQuery yet, so if you could help me with basic js. This is what I tried so far, but it wasn't working.
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<script type="text/javascript" src="assets/js/basic.js"></script>
<meta charset="UTF-8">
</head>
<body>
<header>
<div id="front-page" class="window_height_picture" onload="get_window_height()">
</div>
</header>
</body>
</html>
And this is my .js file:
function get_window_height() {
var window_height = window.innerHeight;
document.getElementById('front-page').style.height = window_height + 'px';
}
I did search for this, but couldn't find what I was looking for. Can you tell me where I was wrong, or provide me with a better code?