Solved

<area> tag and OnMouseOver

Posted on 2000-04-27
4
526 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

776 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