how to force browser focus to area map?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Charles Eubanks

    how to force browser focus to area map?

    The enclosed html snippet displays an area map. The behavior I want
    is for each area to show up (eg show the outline of the poly) when the
    user mouses over it. This happens nicely BUT in order for this to
    occur, the user must hit the tab key to set the focus into the image
    (or the map -- I am not sure which at this point).
    In any case, I need a way to automatically force the browser focus
    into the image (or map) -- because end-users do not understand about
    using the tab key to move browser focus when there is no obvious form
    in front of them.
    So far I have tried several different permutations using focus() and
    setActive() and had no success.

    And lastly, yes, an IE-specific solution is just-fine-thank-you.
    Thanks in advance for your help

    ---------------------------code begins-------------------------
    <html>
    <body>
    <img src="combo1.png "
    onMouseOver="do cument.getEleme ntById('mymap') .setActive()"
    usemap="#mymap"/>
    <map name="mymap" id="mymap">
    <area alt="1" title="1" shape="poly" coords="60,15,9 0,15,90,35,60,3 5"
    tabindex="1"
    onMouseOver="th is.focus();"
    onMouseOut="thi s.blur();"
    href="#" target="_self" />
    <area id="area1" alt="2" title="2" shape="poly" tabindex="2"
    coords="90,120, 110,120,110,140 ,90,140" href="#" target="_self"
    onMouseOver="th is.focus();"
    onMouseOut="thi s.blur();"
    onclick="javasc ript:alert(wind ow.event.srcEle ment.tagName);w indow.event.src Element.focus() "
    />
    </map>
    </body>
    </html>
    ------------------------------code ends-------------------------
  • Stuart Palmer

    #2
    Re: how to force browser focus to area map?

    Well, personally for me in ie 5.5 this code seems to do what you request.
    Even without the focus being on the image (just on the area)

    What browser are you using? It doesn't seem to work in ns 4.75 though, but
    that isn't a suprise really.

    Maybe that helps......what is it not doing for you? it's
    highlighting/focusing on mouseover the area and dehighlighting/bluring on
    mouseout of the area.

    Stu

    "Charles Eubanks" <ceubanks@alpha blox.com> wrote in message
    news:df585a28.0 311131634.71854 32b@posting.goo gle.com...[color=blue]
    > The enclosed html snippet displays an area map. The behavior I want
    > is for each area to show up (eg show the outline of the poly) when the
    > user mouses over it. This happens nicely BUT in order for this to
    > occur, the user must hit the tab key to set the focus into the image
    > (or the map -- I am not sure which at this point).
    > In any case, I need a way to automatically force the browser focus
    > into the image (or map) -- because end-users do not understand about
    > using the tab key to move browser focus when there is no obvious form
    > in front of them.
    > So far I have tried several different permutations using focus() and
    > setActive() and had no success.
    >
    > And lastly, yes, an IE-specific solution is just-fine-thank-you.
    > Thanks in advance for your help
    >
    > ---------------------------code begins-------------------------
    > <html>
    > <body>
    > <img src="combo1.png "
    > onMouseOver="do cument.getEleme ntById('mymap') .setActive()"
    > usemap="#mymap"/>
    > <map name="mymap" id="mymap">
    > <area alt="1" title="1" shape="poly" coords="60,15,9 0,15,90,35,60,3 5"
    > tabindex="1"
    > onMouseOver="th is.focus();"
    > onMouseOut="thi s.blur();"
    > href="#" target="_self" />
    > <area id="area1" alt="2" title="2" shape="poly" tabindex="2"
    > coords="90,120, 110,120,110,140 ,90,140" href="#" target="_self"
    > onMouseOver="th is.focus();"
    > onMouseOut="thi s.blur();"
    >[/color]
    onclick="javasc ript:alert(wind ow.event.srcEle ment.tagName);w indow.event.src E
    lement.focus()"[color=blue]
    > />
    > </map>
    > </body>
    > </html>
    > ------------------------------code ends-------------------------[/color]


    Comment

    • Charles Eubanks

      #3
      Re: how to force browser focus to area map?

      I am running IE6. I will try this on 5.5 and/or 5.0 to see if
      anything is different. The code I included is simplified since there
      are items surrounding the image. But so far even this simple version
      does not seem to work unless the I click on the image and then hit the
      tab key.
      Thanks for your time.

      "Stuart Palmer" <tryandspamme@y oucant.com> wrote in message news:<bp2e23$13 jo$1@sp15at20.h ursley.ibm.com> ...[color=blue]
      > Well, personally for me in ie 5.5 this code seems to do what you request.
      > Even without the focus being on the image (just on the area)
      >
      > What browser are you using? It doesn't seem to work in ns 4.75 though, but
      > that isn't a suprise really.
      >
      > Maybe that helps......what is it not doing for you? it's
      > highlighting/focusing on mouseover the area and dehighlighting/bluring on
      > mouseout of the area.
      >
      > Stu
      >
      > "Charles Eubanks" <ceubanks@alpha blox.com> wrote in message
      > news:df585a28.0 311131634.71854 32b@posting.goo gle.com...[color=green]
      > > The enclosed html snippet displays an area map. The behavior I want
      > > is for each area to show up (eg show the outline of the poly) when the
      > > user mouses over it. This happens nicely BUT in order for this to
      > > occur, the user must hit the tab key to set the focus into the image
      > > (or the map -- I am not sure which at this point).
      > > In any case, I need a way to automatically force the browser focus
      > > into the image (or map) -- because end-users do not understand about
      > > using the tab key to move browser focus when there is no obvious form
      > > in front of them.
      > > So far I have tried several different permutations using focus() and
      > > setActive() and had no success.
      > >
      > > And lastly, yes, an IE-specific solution is just-fine-thank-you.
      > > Thanks in advance for your help
      > >
      > > ---------------------------code begins-------------------------
      > > <html>
      > > <body>
      > > <img src="combo1.png "
      > > onMouseOver="do cument.getEleme ntById('mymap') .setActive()"
      > > usemap="#mymap"/>
      > > <map name="mymap" id="mymap">
      > > <area alt="1" title="1" shape="poly" coords="60,15,9 0,15,90,35,60,3 5"
      > > tabindex="1"
      > > onMouseOver="th is.focus();"
      > > onMouseOut="thi s.blur();"
      > > href="#" target="_self" />
      > > <area id="area1" alt="2" title="2" shape="poly" tabindex="2"
      > > coords="90,120, 110,120,110,140 ,90,140" href="#" target="_self"
      > > onMouseOver="th is.focus();"
      > > onMouseOut="thi s.blur();"
      > >[/color]
      > onclick="javasc ript:alert(wind ow.event.srcEle ment.tagName);w indow.event.src E
      > lement.focus()"[color=green]
      > > />
      > > </map>
      > > </body>
      > > </html>
      > > ------------------------------code ends-------------------------[/color][/color]

      Comment

      Working...