Solved

<area> tag and OnMouseOver

Posted on 2000-04-27
4
524 Views
Last Modified: 2008-03-17
G'day all experts in there !

I have an <AREA> map, and I try to put a MouseOver that display a related text in the status bar, but it seems OnMouseOver isn't recognised in an <area> tag.

I have :
<SCRIPT LANGUAGE="JavaScript">  <!--
function mover(text) { window.status = text;  return true; }
function mout()   { window.status = '';    return true; }
//-->  </SCRIPT>

and
<area shape="rect" coords="286,3,367,21" href="somewhere.htm" OnMouseOver="mover('blabla...');" OnMouseOut="mout('');">

Why doesn'it work ?

What alternative solutions do you propose experts ?

Thanks in advance for your precious time and your help.
0
Comment
Question by:ESI
  • 3
4 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 2755219
Try it without the mouseout handlers:

<HTML>
<HEAD>
<TITLE></title>

<SCRIPT LANGUAGE="JavaScript">  
<!--
  function mover(text) { window.status = text;  return true; }
  function mout()   { window.status = '';    return true; }
//-->
</script>

</head>

<BODY>

<MAP name="options">
<AREA shape="rect" coords="  0,  0, 99, 99"  alt="hello"   href="somewhere.htm" onMouseOver="mover('blah');">
<AREA shape="rect" coords="100,100,199,199"  alt="goodbye" href="somewhere.htm" onMouseOver="mover('bunk');">
</map>

<IMG name='mymapimg' src='dot.gif' USEMAP="#options" BORDER="1" WIDTH="200" HEIGHT="200">

</body>
</html>


__________________________________________________________________________________________________________________
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 100 total points
ID: 2755251
NOPE!  That didn't work right, but this does!  :)


<HTML>
<HEAD>
<TITLE></title>

<SCRIPT LANGUAGE="JavaScript">  
<!--
  var stattxt="";

  function mover(txt)
  {
    stattxt = txt;
    setTimeout("top.status=stattxt",10);
  }
//-->
</script>

</head>

<BODY>

<MAP name="options">
<AREA shape="rect" coords="  0,  0, 99, 99"  alt="hello"   href="somewhere.htm" onMouseOver="mover('blah');if(document.all)this.focus();">
<AREA shape="rect" coords="100,100,199,199"  alt="goodbye" href="somewhere.htm" onMouseOver="mover('bunk');if(document.all)this.focus();">
</map>

<IMG name='mymapimg' src='dot.gif' USEMAP="#options" BORDER="1" WIDTH="200" HEIGHT="200">

</body>
</html>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2755310
I know I'm repeating myself, but ...

..... and now you can put this back in:
  onMouseOut="mover('');"

You may also want to remove the following which I included just for testing:

 if(document.all)this.focus();


_________________________________________________________________________________________________________________________________
0
 
LVL 3

Author Comment

by:ESI
ID: 2756096
Hi again,
<See my comment in the JavaScript section of that bright site>

CU around
ESI
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now