I'm trying to figure out a workaround to a minor annoyance that I'm
coming up with while coding a site. I've got some keyboard shortcuts
set up for the site via javascript, and when I press escape, it's set
to hide several divs on the page, and remove focus from a link.
Unfortunately, I don't know which link will have focus, so I can't
just blur a particular element (that I'm aware of) since I won't know
which element it is. I got it working by using window.blur() followed
by window.focus(). The problem is that if I have a source code window
open, the window.focus() function brings the source code on top of
everything else and it takes focus. I don't see this being a huge
issue for users, but it's a real pain while I'm developing the site.
Does anyone know why it does this, and, more importantly, a workaround
for it?
Thanks in advance. 4 2103
Spizzat2 said the following on 1/8/2008 9:02 AM:
I'm trying to figure out a workaround to a minor annoyance that I'm
coming up with while coding a site. I've got some keyboard shortcuts
set up for the site via javascript, and when I press escape, it's set
to hide several divs on the page, and remove focus from a link.
Unfortunately, I don't know which link will have focus, so I can't
just blur a particular element (that I'm aware of) since I won't know
which element it is. I got it working by using window.blur() followed
by window.focus(). The problem is that if I have a source code window
open, the window.focus() function brings the source code on top of
everything else and it takes focus. I don't see this being a huge
issue for users, but it's a real pain while I'm developing the site.
Does anyone know why it does this, and, more importantly, a workaround
for it?
Thanks in advance.
When you blur the window, in Windows, it will go to the next application
in the active list. Alt-Tab and you will find your source window the
next "in line". It isn't explicitly picking the source code window to go
to, it just happens to be the next in line.
Try focusing an element in the page and then blur that element instead
of the window.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
On Jan 8, 1:20 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
Spizzat2 said the following on 1/8/2008 9:02 AM:
I'm trying to figure out a workaround to a minor annoyance that I'm
coming up with while coding a site. I've got some keyboard shortcuts
set up for the site via javascript, and when I press escape, it's set
to hide several divs on the page, and remove focus from a link.
Unfortunately, I don't know which link will have focus, so I can't
just blur a particular element (that I'm aware of) since I won't know
which element it is. I got it working by using window.blur() followed
by window.focus(). The problem is that if I have a source code window
open, the window.focus() function brings the source code on top of
everything else and it takes focus. I don't see this being a huge
issue for users, but it's a real pain while I'm developing the site.
Does anyone know why it does this, and, more importantly, a workaround
for it?
Thanks in advance.
When you blur the window, in Windows, it will go to the next application
in the active list. Alt-Tab and you will find your source window the
next "in line". It isn't explicitly picking the source code window to go
to, it just happens to be the next in line.
Try focusing an element in the page and then blur that element instead
of the window.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
It still brings up the source code window regardless of source code's
position in the Alt-Tab list, but thanks for the potential solution.
I'll give it a shot and see how it works for my situation.
On Jan 9, 9:27 am, Spizzat2 <Spizz...@gmail.comwrote:
On Jan 8, 1:20 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
Spizzat2 said the following on 1/8/2008 9:02 AM:
I'm trying to figure out a workaround to a minor annoyance that I'm
coming up with while coding a site. I've got some keyboard shortcuts
set up for the site via javascript, and when I press escape, it's set
to hide several divs on the page, and remove focus from a link.
Unfortunately, I don't know which link will have focus, so I can't
just blur a particular element (that I'm aware of) since I won't know
which element it is. I got it working by using window.blur() followed
by window.focus(). The problem is that if I have a source code window
open, the window.focus() function brings the source code on top of
everything else and it takes focus. I don't see this being a huge
issue for users, but it's a real pain while I'm developing the site.
Does anyone know why it does this, and, more importantly, a workaround
for it?
Thanks in advance.
When you blur the window, in Windows, it will go to the next application
in the active list. Alt-Tab and you will find your source window the
next "in line". It isn't explicitly picking the source code window to go
to, it just happens to be the next in line.
Try focusing an element in the page and then blur that element instead
of the window.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
It still brings up the source code window regardless of source code's
position in the Alt-Tab list, but thanks for the potential solution.
I'll give it a shot and see how it works for my situation.
Well, I got a solution that works using your method, so thank you for
that. I'm still confused about the cause of the problem, though. I
wonder if the source code page is considered a child window of the
parent, so when it brings it into focus, it just grabs the child-most
window (if that makes any sense).
Oh well, it works. I'm happy.
Spizzat2 said the following on 1/9/2008 10:45 AM:
On Jan 9, 9:27 am, Spizzat2 <Spizz...@gmail.comwrote:
>On Jan 8, 1:20 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
>>Spizzat2 said the following on 1/8/2008 9:02 AM: I'm trying to figure out a workaround to a minor annoyance that I'm coming up with while coding a site. I've got some keyboard shortcuts set up for the site via javascript, and when I press escape, it's set to hide several divs on the page, and remove focus from a link. Unfortunately, I don't know which link will have focus, so I can't just blur a particular element (that I'm aware of) since I won't know which element it is. I got it working by using window.blur() followed by window.focus(). The problem is that if I have a source code window open, the window.focus() function brings the source code on top of everything else and it takes focus. I don't see this being a huge issue for users, but it's a real pain while I'm developing the site. Does anyone know why it does this, and, more importantly, a workaround for it? Thanks in advance. When you blur the window, in Windows, it will go to the next application in the active list. Alt-Tab and you will find your source window the next "in line". It isn't explicitly picking the source code window to go to, it just happens to be the next in line. Try focusing an element in the page and then blur that element instead of the window.
It still brings up the source code window regardless of source code's position in the Alt-Tab list, but thanks for the potential solution. I'll give it a shot and see how it works for my situation.
Well, I got a solution that works using your method, so thank you for
that. I'm still confused about the cause of the problem, though.
When you say "Source code window", are you referring to Notepad or some
other app that you use, or, an editing product where you preview it in
the program and then you can use the source code window?
I wonder if the source code page is considered a child window of the
parent, so when it brings it into focus, it just grabs the child-most
window (if that makes any sense).
Oh well, it works. I'm happy.
It could very well be that it is simply focusing the last window to have
focus before the current one. What an OS does when you blur a window is
up to the OS and not a lot that MS does makes any sense.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dom Nicholas |
last post by:
Hi,
My question is this : how do I detect from
another window which didn't create a new window whether
it exists ? For example, is there a window-id's container
of some sort that hangs around...
|
by: Fred Snider |
last post by:
Help!
Opening a new window using the window.open( ) command works great
for opening new windows and having them on top and having the focus.
The window.focus command brings any existing...
|
by: Benno Bös |
last post by:
If I use the following construct in the frame "main" for a link to an
extern site:
<A HREF="http://www.any.xy" TARGET="extern">
the Browser is creating the window "extern", loading the page...
|
by: Darren |
last post by:
I have a page that opens a popup window and within the window, some databse
info is submitted and the window closes. It then refreshes the original
window using window.opener.location.reload(). ...
|
by: Csaba Gabor |
last post by:
Up until a few weeks ago, javascript code like
window.open("http://mydomain.com", "windowName");
would always bring my new or reused window to the top, with focus.
Lately, Firefox (Deer park...
|
by: dbuchanan |
last post by:
Hello,
A section in Data Sources window is mystifying to me.
In the case of my code the Data Sources window shows my references to
the data access layer.
First here is what I see in my Data...
|
by: tochiromifune |
last post by:
Hello
The window.open method brings my window to the top only if it is new. If
it's being reused, the window does not come to the foreground (with IE 6 it
does).
Is there a new way in...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Johno34 |
last post by:
I have this click event on my form. It speaks to a Datasheet Subform
Private Sub Command260_Click()
Dim r As DAO.Recordset
Set r = Form_frmABCD.Form.RecordsetClone
r.MoveFirst
Do
If...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
| |