Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to visualise/debug an imagemap?

Tags:

html

imagemap

I'm dynamically generating an imagemap for a chart tool I have.

I was hoping to be able to set a border or color on the area tags so I could check everything was being generated with the right coords, but a little research shows this is not possible.

So whats the easiest way to check my image map is correct? Are there any browser tools which will "visualise" the areas?

like image 772
fearofawhackplanet Avatar asked Jan 04 '10 11:01

fearofawhackplanet


People also ask

How do you see an image map?

Right-click your image and choose "Inspect Element with FireBug" In the HTML tab of Firebug, the image tag is highlighted: locate and expand the associated map tag, which usually is right after it. You can now place your mouse over each area tags to see them highlighted over your image.

How do I add a tooltip to an image map?

Define your TooltipOpen the Tooltip Magic Advanced UI: For Trigger Element, select the default Tag Name and set the tag to AREA. For Content Source, select the default Attribute of Trigger and set the attribute to alt. Preview your page and enjoy the tooltips!


4 Answers

What about using JavaScript (and jQuery) to test it?

http://davidlynch.org/js/maphilight/docs/demo_usa.html

This plugin will highlight image map areas.

like image 66
alex Avatar answered Oct 20 '22 16:10

alex


You can use FireBug for that:

  • Right-click your image and choose "Inspect Element with FireBug"
  • In the HTML tab of Firebug, the image tag is highlighted: locate and expand the associated map tag, which usually is right after it
  • You can now place your mouse over each area tags to see them highlighted over your image
like image 25
jonjbar Avatar answered Oct 20 '22 18:10

jonjbar


One way to visualize an area tag in Chrome is to add a tabindex to the area tag(s) you want to see, and then click or tab to it. Chrome will nicely highlight the actual outline of the clickable area.

This solution unfortunately doesn't work in Firefox.

like image 6
Zefira Avatar answered Oct 20 '22 17:10

Zefira


Image Map Editor is a plug-in for Firefox. It is the best tool I have found so far, makes creating, inspecting, and editing image maps very easy.

like image 4
Henrik Christensen Avatar answered Oct 20 '22 16:10

Henrik Christensen