Problem with focus and keystrokes in IE 6 and 7

H

hitide

I made an interactive webpage, wich should be controlled with
keystrokes via javascript. My problem is, that in IE6 (witch latest
update) and IE 7 it does only work, when I place a mouseclick into the
page. No matter where. Then the keystroke is recognized and the desired
function (one page further) works. When the new page is loaded, the
problem starts again. The keystrokes are just recognized when I click
into the page.
Can anyone help me?

Thanks,
Johannes
 
M

Markus Ernst

hitide said:
I made an interactive webpage, wich should be controlled with
keystrokes via javascript. My problem is, that in IE6 (witch latest
update) and IE 7 it does only work, when I place a mouseclick into the
page. No matter where. Then the keystroke is recognized and the desired
function (one page further) works. When the new page is loaded, the
problem starts again. The keystrokes are just recognized when I click
into the page.
Can anyone help me?

I am not sure, but it is possible that in IE the focus is somewhere
outside the viewport when a page is loaded. Try to put the focus
somewhere inside the page on load:

<body onLoad="document.getElementById('startHere').focus()">
<div id="startHere">Now I guess the focus is here</div>

I have not tested this, though - it is just an idea.
 
H

hitide

Thanks for the quick answer, but unfortunally it does not work.
So I sit and wait for a new inspiration....

Thanks,
Johannes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top