Mozilla blur() problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • delerious@no.spam.com

    #1

    Mozilla blur() problem

    Please take a look at this page:



    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?

  • Martin Honnen

    #2
    Re: Mozilla blur() problem



    delerious@no.sp am.com wrote:
    [color=blue]
    > 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.[/color]

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

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • delerious@no.spam.com

      #3
      Re: Mozilla blur() problem

      On Sat, 20 Dec 2003 11:53:28 +0100, Martin Honnen <mahotrash@yaho o.de> wrote:[color=blue]
      >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.[/color]

      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. :-)

      Comment

      Working...