S
Spizzat2
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.
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.