problem with focusing in frames

R

Ricardo Garcia

hi, i have the next situation:
an index.html that has 2 frames (the main and the navigation bar)
and the next problem (in IE, in Mozilla it works properly):

when i start to scroll in the main window, it blurs, and of course, it
finish scrolling, you must click to focus again. This is rather annoying.
And i know that the other frame does not get the focus (i put an alert if it
got, and it didn´t appear)
I know is a problem of the focus because i put en the main frame:
<body onblur()="javascript:window.focus()">
and the scrolling worked properly. But know the problems is that i cant use
the navigation bar (if i click, as the main window lost the focus and get it
again, the navigation bar doesnt work)

i thought then in typing something like:
<body onblur()="javascript:if (!window.top.frame[0].isFocused())
window.focus()">
but i can´t see any isFocused() method


Could someone help me plz!!!!

Thx
 
L

Lee

Ricardo Garcia said:
hi, i have the next situation:
an index.html that has 2 frames (the main and the navigation bar)
and the next problem (in IE, in Mozilla it works properly):

when i start to scroll in the main window, it blurs, and of course, it
finish scrolling, you must click to focus again. This is rather annoying.
And i know that the other frame does not get the focus (i put an alert if it
got, and it didn´t appear)
I know is a problem of the focus because i put en the main frame:
<body onblur()="javascript:window.focus()">
and the scrolling worked properly. But know the problems is that i cant use
the navigation bar (if i click, as the main window lost the focus and get it
again, the navigation bar doesnt work)

i thought then in typing something like:
<body onblur()="javascript:if (!window.top.frame[0].isFocused())
window.focus()">
but i can´t see any isFocused() method

In general, it's best to let the browser decide what has focus,
but one way to do what you seem to want is to have the onblur
handler use setTimeout() to schedule focus to return in about
500ms, and to have the onfocus handler of the navigation frame
call clearTimeout() to cancel that.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top