Mozilla blur() problem

D

delerious

Please take a look at this page:

http://home.comcast.net/~delerious1/index10b.html

There is javascript code that is executed when the page is loaded. The code
calls the focus() method and then the blur() method on the first anchor in the
box. In IE and Opera the code works. But in Mozilla, you can see the dotted
line around the first anchor, so it's as if the blur() method is not working.

Anyone know what's going on?
 
M

Martin Honnen

Please take a look at this page:

http://home.comcast.net/~delerious1/index10b.html

There is javascript code that is executed when the page is loaded. The code
calls the focus() method and then the blur() method on the first anchor in the
box. In IE and Opera the code works. But in Mozilla, you can see the dotted
line around the first anchor, so it's as if the blur() method is not working.

When I load the page with Netscape 7.1 then indeed there is a dotted
line around the first link, but when I hit enter on the keyboard the
link is not followed thus I think the blur() call works as far as
ensuring that the link doesn't have focus, only Mozilla seems to have a
bug to remove the dotted focus outline.
 
D

delerious

When I load the page with Netscape 7.1 then indeed there is a dotted
line around the first link, but when I hit enter on the keyboard the
link is not followed thus I think the blur() call works as far as
ensuring that the link doesn't have focus, only Mozilla seems to have a
bug to remove the dotted focus outline.

Hmm, that's an interesting observation. I had thought that the blur() call
wasn't doing anything. I fixed this particular problem by making an
additional call to blur(), before the other calls. So instead of having:

element.focus();
element.blur();

I now have:

element.blur();
element.focus();
element.blur();

Now Mozilla doesn't have the dotted line anymore, and I had thought it was
because only the first call to blur() did anything while the subsequent calls
to focus() and blur() didn't do anything. But from what you say, that may not
be the case. Well, whatever, I have it working, that's all that matters. :)
 

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
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top