Solved

HTML map hotspots not working in Firefox

Posted on 2011-09-06
8
268 Views
Last Modified: 2012-06-27
I have the attached code to generate hotspots in a map that will redirect to another page. ITt works fine on IE but does not seem to work on Firefox. It seems only a very small portion in the bottom of the image seems to work. Please help. thanks
<div style="Z-INDEX: 102; LEFT: 189px; POSITION: absolute; TOP: 157px; " >  
                <img style="Z-INDEX: 102; LEFT: 4px; POSITION: absolute; TOP: 4px; width: 500px; height: 280px;border:0px;"  src="/images/Sale.jpg" width="145" height="126" alt="ProductsOnSale" usemap="#mapProduct"   />
                <map name="ProductsOnSale" name = "mapProduct" id="mapProduct">           
                <area shape="rect" coords="15,125,145,280" href="/product.aspx?prd=9308222&s=1" alt="15 Sheet Capacity" />
                <area shape="rect" coords="136,125,260,280" href="/product.aspx?prd=9308206&s=1" alt="20 Sheet Capacity" />				    
			    <area shape="rect" coords="251,125,380,280" href="/product.aspx?prd=9308230&s=1" alt="25 Sheet Capacity" />			
			    <area shape="rect" coords="371,125,500,280" href="/product.aspx?prd=9308214&s=1" alt="65 Sheet Capacity" />	
			    </map>	
           </div>

Open in new window

0
Comment
Question by:TrialUser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 16

Expert Comment

by:sjklein42
ID: 36493142
Firefox is ignoring the non-standard attribute useMap on the href tag.  

Similar problem solved here:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/HTML/Q_26875761.html

Uses javascript to set the useMap attribute.
0
 
LVL 5

Expert Comment

by:winthropj
ID: 36493185
It seems to work if you specify the link path as href="./product.aspx?prd=9308222&s=1"
<div style="Z-INDEX: 102; LEFT: 189px; POSITION: absolute; TOP: 157px; " >  
     <img style="Z-INDEX: 102; LEFT: 4px; POSITION: absolute; TOP: 4px; width: 500px; height: 280px;border:0px;"  src="/images/Sale.jpg" width="145" height="126" alt="ProductsOnSale" usemap="#mapProduct"   />
     <map name="ProductsOnSale" name = "mapProduct" id="mapProduct">           
     <area shape="rect" coords="15,125,145,280" href="./product.aspx?prd=9308222&s=1" alt="15 Sheet Capacity" />
     <area shape="rect" coords="136,125,260,280" href="./product.aspx?prd=9308206&s=1" alt="20 Sheet Capacity" />				    
     <area shape="rect" coords="251,125,380,280" href="./product.aspx?prd=9308230&s=1" alt="25 Sheet Capacity" />			
     <area shape="rect" coords="371,125,500,280" href="./product.aspx?prd=9308214&s=1" alt="65 Sheet Capacity" />	
     </map>	
</div>

Open in new window

0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 36493225
Maybe because you have two 'name' attributes when there should be only one.

<map name="ProductsOnSale" name = "mapProduct" id="mapProduct">
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:TrialUser
ID: 36495323
Removed the name attribute still doesnt work
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36497348
Ok, this works in Firefox but Only if the image is actually displayed.  Until I substituted an image in there, the hotspots didn't work.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Usemap</title>
</head>
<body>
<h1>Usemap</h1>
<div style="z-index: 102; left: 189px; position: absolute; top: 157px; " >  
     <img style="z-index: 102; left: 4px; position: absolute; top: 4px; width: 500px; height: 280px; border:0px;"  src="flowercrop22.jpg" alt="ProductsOnSale" usemap="#mapProduct"   />
     <map name = "mapProduct" id="mapProduct">           
     <area shape="rect" coords="15,125,145,280" href="./product.aspx?prd=9308222&s=1" alt="15 Sheet Capacity" />
     <area shape="rect" coords="136,125,260,280" href="./product.aspx?prd=9308206&s=1" alt="20 Sheet Capacity" />                                   
     <area shape="rect" coords="251,125,380,280" href="./product.aspx?prd=9308230&s=1" alt="25 Sheet Capacity" />                       
     <area shape="rect" coords="371,125,500,280" href="./product.aspx?prd=9308214&s=1" alt="65 Sheet Capacity" />       
     </map>     
</div>
</body>
</html>

Open in new window

0
 
LVL 5

Assisted Solution

by:winthropj
winthropj earned 250 total points
ID: 36498235
It was working for me without the image. It showed the outline and when mousing over the different areas showed the proper path info.
0
 
LVL 16

Expert Comment

by:sjklein42
ID: 36498286
Buggy behavior all depends on which version of Firefox you are running.
0
 

Author Closing Comment

by:TrialUser
ID: 36578031
thx
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

695 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