Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

usemap problem

Status
Not open for further replies.

mnassih

IS-IT--Management
Jun 29, 2005
64
SE
Hi,
My problem is that I can not to have a map image with the link to the
Thanks in advance for the help

M.N

---
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Nouvelle page 1</title>
</head>

<body>

<p><b><font size="2" color="#000000" face="Courier New">
<MAP name="map1">
<AREA
onclick="MM_openBrWindow(' shape=RECT coords=193,4,322,17 href=" border="0" src="index.3.gif" useMap="#map1">
</font></b></p>
</body>
</html>
 
Hi mnassih,

for future posts, please surround your code examples with [tt][ignore]
Code:
 [/code[[/ignore][/tt][/color] for improved readability.

[code]
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Nouvelle page 1</title>
</head>

<body>

<p><b><font size="2" color="#000000" face="Courier New">
<MAP name="map1">
  <AREA
  [COLOR=blue]onclick="[COLOR=red]MM_openBrWindow[/color]('[URL unfurl="true"]http://site.come..','Guestbook',[/URL] 'status=yes,scrollbars=yes,width=520,height=500')"[/color]
  shape=RECT coords=193,4,322,17 href="[URL unfurl="true"]http://www...com/#"></MAP><img[/URL] border="0" src="index.3.gif" useMap="#map1">
</font></b></p>
</body>
</html>
You don't appear to have declared [tt]MM_openBrWindow[/tt] anywhere.


It's also good practice to use the same URL for the HREF as you use in a JavaScript window.open - this ensures non-JavaScript browsers still work:
Code:
  <AREA
  onclick="MM_openBrWindow('[COLOR=red][URL unfurl="true"]http://site.come..[/URL][/color]','Guestbook', 'status=yes,scrollbars=yes,width=520,height=500')"[/color]
  shape=RECT coords=193,4,322,17 [COLOR=red]href="[URL unfurl="true"]http://site.come.."[/URL][/color]>
or even better:
Code:
  <AREA
  onclick="MM_openBrWindow([COLOR=red]rhis.href[/color],'Guestbook', 'status=yes,scrollbars=yes,width=520,height=500')"[/color]
  shape=RECT coords=193,4,322,17 [COLOR=red]href="[URL unfurl="true"]http://site.come.."[/URL][/color]>

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
I still have the same pb.
Here is the code with the function.

thanks.

<code :

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Nouvelle page 1</title>
</head>

<body>

<p><b><font size="2" color="#000000" face="Courier New">

<SCRIPT type=text/javascript>

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

</SCRIPT>

<MAP name="map1">
<AREA
onclick="MM_openBrWindow(' shape=RECT coords=193,4,322,17 href=" border="0" src="index.3.gif" useMap="#map1">
</AREA>

</font></b></p>

</body>

</html>
 
I tested your code and it works (in Firefox) - perhaps you could explain the problem some more - what happens when you click the area?

By the way, are you aware that the area specified is only 13 pixels high?


Overall though, your HTML is malformed: you're overlapping all sorts of tags which shouldn't be overlapped. The <b> and <font> tags are redundant for an image (and deprecated in favour of css), and there's a redundant </area> tag after the </map>. And the <script> really should be in the head, not the body. And you should use [tt]return false;[/tt] to supress following the href when JS is enabled. And you should use a DocType which matches the code you're using.

Code:
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  <meta name="ProgId" content="FrontPage.Editor.Document">
  <title>Nouvelle page 1</title>
  <script type=text/javascript>
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
      return false;
    }
  </script>

</head>

<body>
  <img border="0" src="index.3.gif" useMap="#map1">

  <map name="map1">
    <area
      shape="RECT" coords="193,4,322,17"
      onclick="return(MM_openBrWindow(this.href,'Guestbook', 'status=yes,scrollbars=yes,width=520,height=500'));"
      href="[URL unfurl="true"]http://interactives.alxnet.com/cgi-bin/slither/Driver.py/[/URL] InterActives/Guestbook/Guestbook .render?guestbook_id=55187">
  </map>

</body>

</html>

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
thanks, but I still have the same problem, I have not the link when I move the mouse on the image. (no link).
I use Microsoft explorer 6.0. and front page.

 
That's probably because the area is so small.

[tt][COLOR=black grey]

[COLOR=white black] [/color]








[/color][/tt]
Your area is a box 13px high by 129px wide, with the topleft of the box 4px from the top of the image and roughly 200px from the left of the image.

It's a small area. Try pressing the [tt][ignore][tab][/ignore][/tt] key - this should highlight the area on the image.

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top