I have a page consisting of three div sections.
<div id="header">
<!--header html goes here-->
</div>
<div id="body" class="page-body">
<!--main html goes here-->
</div>
<div id="footer">
<!--footer html goes here-->
</div>
and my css is
body {
overflow: hidden;
}
.page-body
{
overflow: auto;
}
The problem with this is if user pressed PgDn or down arrow key then the page doesn't scroll down. In order for page to scroll down through keyboard the user has to first click on page-body div section and then the key presses work.
I have tried using autofocus tag on the page-body div or writing document.getElementById('page-body').focus() on load, but nothing seems to work. How can I get keyboard to work as soon as page loads without having to click on the section? I would prefer solution without javascript since my page doesn't really need it, but if I have to I am ok with javascript solution too.