By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

problem with focusing in frames

P: n/a
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

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.