how to force browser focus to area map?

C

Charles Eubanks

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="document.getElementById('mymap').setActive()"
usemap="#mymap"/>
<map name="mymap" id="mymap">
<area alt="1" title="1" shape="poly" coords="60,15,90,15,90,35,60,35"
tabindex="1"
onMouseOver="this.focus();"
onMouseOut="this.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="this.focus();"
onMouseOut="this.blur();"
onclick="javascript:alert(window.event.srcElement.tagName);window.event.srcElement.focus()"
/>
</map>
</body>
</html>
------------------------------code ends-------------------------
 
S

Stuart Palmer

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
 
C

Charles Eubanks

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.
 

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

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top