Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3225766
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:22:39+00:00 2026-05-17T16:22:39+00:00

I’m making an image map of the world map where moving the mouse over

  • 0

I’m making an image map of the world map where moving the mouse over different parts of the
world should highlight that part of the world.

I do this by loading images of the different regions into an (initially) empty ‘div’ and positioning them on top of the world map with CSS and absolute positioning. It works well except that the transparent parts of the images that I lay over the world map in some cases cover another area which stops the mouse over events from coming through the layover/highlight image through to the image map.

Is there any way to get the events through to the image map or is should I take a completely different approach?

Any help will be greatly appreciated.

Here is some code to show what I’m doing.
First you see the JavaScript code that replaces the inner HTML code of a ‘div’ with the code for the the image that needs to be loaded to highlight a particular region

<script type="text/javascript">

function highlight_map_area(area)
{
switch(area)
{
    case 1:
        document.getElementById("marker").innerHTML='<img src="/media/img/world_map/canada.png" style="position:absolute; z-index:1; left:53px; top:1px;">'
        // ...
        break;
    // Then all the other case statements ...
}
}
</script>

Here is how I load the image map (with the image of the world map):

<div style="position:relative; float:left; margin:10px;">
   <img src=/media/img/world_map/world_map.png width ="699" height ="357" usemap="#world_map">
   <div id="marker">
   </div>
</div>

And here is the map itself:

<map name="world_map">
   <area shape ="rect" coords ="0,0,210,80" onMouseOver="highlight_map_area(1)" alt="Canada" />
   <!-- All the other regions to be selectable... -->
   <area shape ="rect" coords ="563,240,698,356" onMouseOver="highlight_map_area(8)" alt="Australia and South Pacific" />
</map>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:22:40+00:00Added an answer on May 17, 2026 at 4:22 pm

    I created a similar application a while ago http://bit.ly/a3BJqA.

    Create three states for each region image – default, mouseover and active.
    Use css to control the position of each region on the map.

    <div id="mapDiv">
        <img src="img_src" name="img1" title="Northern Cape" id="img1">
        <img src="img_src" name="img2" title="Northern Cape" id="img2">
        <img src="img_src" name="img3" title="Northern Cape" id="img3">
        <img src="img_src" name="img4" title="Northern Cape" id="img4">
        <img src="img_src" name="img5" title="Northern Cape" id="img5">
        <img src="img_src" name="img6" title="Northern Cape" id="img5">
        <!-- More images -->
    </div>
    

    The JavaScript would look like the function below.

    function mapAnimation() {
        var map_images = $$('#mapDiv img'); 
    
        for (var i = 0; i < map_images.length; i++) {   
            map_images[i].onmouseover = function(){ 
               // mouseover image                     
            };
            map_images[i].onmouseout = function(){                                      
                 // default image  
            };
            map_images[i].onclick = function(){ 
               // active image and more actions      
            };                                       
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.