Two very different window.blur() results

G

George Hester

http://home.nycap.rr.com/foryorisonly/site.htm

The top one is very different from the bottom one. If you do not recognize the difference
scroll the images to the right. Not that the toolbar File | View is enabled for the top blured
window and disabled for the bottom.

These are the same exact windows both blured using window.blur(); How is it done?
Well to tell you the truth I'd prefer it NOT to happen. I am expecting a window.blur() to give
the bottom window. Not the top. But yes that is the behavior I am getting.

When I use window.blur() can you suggest any way so that the top one never occurs?

The code is this:

<script type="text/javascript">
window.onblur = window_onblur;
function window_onblur(){
window.blur();
}
</script>
 
R

Randy Webb

George said:
http://home.nycap.rr.com/foryorisonly/site.htm

The top one is very different from the bottom one. If you do not recognize the difference
scroll the images to the right. Not that the toolbar File | View is enabled for the top blured
window and disabled for the bottom.

These are the same exact windows both blured using window.blur(); How is it done?
Well to tell you the truth I'd prefer it NOT to happen. I am expecting a window.blur() to give
the bottom window. Not the top. But yes that is the behavior I am getting.

When I use window.blur() can you suggest any way so that the top one never occurs?

The code is this:

<script type="text/javascript">
window.onblur = window_onblur;
function window_onblur(){
window.blur();
}
</script>

That is a very good example of what you get - unpredictable results -
when you duplicate what the browser is doing. When the window gets
blurred, it has to regain focus and then blur itself, to get back where
you were to start with.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
 
G

George Hester

Randy Webb said:
That is a very good example of what you get - unpredictable results -
when you duplicate what the browser is doing. When the window gets
blurred, it has to regain focus and then blur itself, to get back where
you were to start with.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?

Thanks Randy:
It's actually helpful this behavior in what I am doing but I don't like it. It seems to me if the Window is blurred once then when it is blurred again it should exhibit the same behavior as it did the first time it was blurred. But I am finding that not to be the case. This does happen with consistency. The file menu will enable 1 3 5 7 and the other 2 4 6 8. It's a toggle. Too bad I can't use javascript to make the toggle skip a beat???

"When the window gets blrred..." follow you there. "...it has to regain focus..." - right that's what is happening by clicking on the title bar - ".."and then blur itself" - ah so that regaining focus only to immediately blur again causes this behavior. Is this just a Microsoft Internet Explorer issue or do other browsers exhibit similar behavior using window.blur()?
 
R

Randy Webb

George said:
Thanks Randy:
It's actually helpful this behavior in what I am doing but I don't like it.
It seems to me if the Window is blurred once then when it is blurred again it
should exhibit the same behavior as it did the first time it was blurred. But
I am finding that not to be the case. This does happen with consistency. The
file menu will enable 1 3 5 7 and the other 2 4 6 8. It's a toggle. Too bad
I can't use javascript to make the toggle skip a beat???

Maybe you could double blur it. Just double the code you have now. That
should cause it - theoretically - to skip a beat.
"When the window gets blrred..." follow you there. "...it has to regain focus..."
- right that's what is happening by clicking on the title bar - ".."and then blur
itself" - ah so that regaining focus only to immediately blur again causes this
behavior. Is this just a Microsoft Internet Explorer issue or do other browsers
exhibit similar behavior using window.blur()?

I can't even get IE to duplicate that behavior. But Mozilla doesn't
display that behaovior either.
 
G

George Hester

Randy Webb said:
Maybe you could double blur it. Just double the code you have now. That
should cause it - theoretically - to skip a beat.


I can't even get IE to duplicate that behavior. But Mozilla doesn't
display that behaovior either.

OK I will try to put together a working exhibition of this behavior this weekend and I'll post it back here. If you
do not have access to either IE 5 or IE 5.5 then you won't see it. It doesn't happen in IE 6. It might you just
cannot see it.

It's funny that you mention "doubling up the code" because that is in fact what I did to make this
experiemnt work in the first place. This is the best I can do and now I'm stumped. I never expected
the only shortoming in this to be a toggling file menu.

But like I said it is sort of a saving grace. Because without it I wouldn't be able to View | Refresh. And no
F5 won't do nothing. Remember it is out of focus.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top