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 8214189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:22:37+00:00 2026-06-07T11:22:37+00:00

I am creating an interactive map in jQuery, and am using a custom hand-drawn

  • 0

I am creating an interactive map in jQuery, and am using a custom hand-drawn map. I have a series of “trigger points” placed throughout the map, absolutely positioned, relative to the size of the map. WHen a use hovers over these trigger points, a tooltip is displayed with information about the location.

HTML/CSS:

<div id="map" style="position:relative; background: url(images/map.jpg">
    <div class="trigger" data-loc="locationA" style="position:absolute; left:10px; top:3px"><h1 class="tooltip">Location A Title</h1></div>
    <div class="trigger" data-loc="locationB" style="position:absolute; left:0px; top:24px"><h1 class="tooltip">Location B Title</h1></div>
    <div class="trigger" data-loc="locationC" style="position:absolute; left:140px; top:35px"><h1 class="tooltip">Location C Title</h1></div>
    <div class="trigger" data-loc="locationD" style="position:absolute; left:70px; top:103px"><h1 class="tooltip">Location D Title</h1></div>
</div>

JQuery:

$(".trigger").hover(function(){
   $(this).find(".tooltip").fadeIn();
}, function(){
   $(this).find(".tooltip").fadeOut();
});

A few Questions:
1) Is this the best way to go about a basic interactive map with JQuery?

2) I want to have a list of locations off to the right. When a user clicks on the link it should ALSO trigger the tooltip for that pertaining link. As shown above, there is a data-loc attribute in each trigger-point. If I set the same data-points in the anchor links to the right, how would I use jQuery to link them up and trigger the fading in and out of the pertaining tooltip?

  • 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-06-07T11:22:39+00:00Added an answer on June 7, 2026 at 11:22 am

    To my knowledge there isn’t a best way to do this. One slightly more descriptive way is to use the area tag instead of a div.

    <!DOCTYPE >
    <html>
    <body>
      <img src="image/all balls.jpg" style="width: 450px; height: 450px;" 
           alt="Balls" usemap="#BallMap" />
      <map name="BallMap">
        <area id="whiteArea" class="hoverArea" shape="circle" coords="78,81,76.5" 
              nohref="nohref" alt="white" />
        <area id="blueArea" class="hoverArea" shape="circle" coords="260,81,76.5" 
              nohref="nohref" alt="blue" />
        <area id="redArea" class="hoverArea" shape="circle" coords="84,254,76.5"
              nohref="nohref" alt="red" />
      </map>
    </body>
    </html>
    

    Then similarly:

    $(".hoverArea").hover(function(){
       showToolTip($(this));
    }, function(){
       hideToolTip($(this));
    });
    

    Probably a little more work to write the custom functions for showing a tooltip. (note: I’ve never used Area myself. )

    Update

    There are a couple of ways to accomplish this.

    A semi-hacky way, since you are already using absolutes is to put another div around the current div’s but have them absolutely positioned way to the right. Hacky but works.

    I wouldn’t do that, cause this would be way better in my opinion:

    <div id="map" style="position:relative; background: url(images/map.jpg">
      <div class="trigger" data-loc="locationA" id="locationA"
           style="position:absolute; left:10px; top:3px">
        <h1 class="tooltip">Location A Title</h1>
      </div>
      <div class="trigger" data-loc="locationB" id="locationB" 
           style="position:absolute; left:0px; top:24px">
        <h1 class="tooltip">Location B Title</h1>
      </div>
      <div class="trigger" data-loc="locationC" id="locationC"
           style="position:absolute; left:140px; top:35px">
        <h1 class="tooltip">Location C Title</h1>
      </div>
      <div class="trigger" data-loc="locationD" id="locationD"
           style="position:absolute; left:70px; top:103px">
        <h1 class="tooltip">Location D Title</h1>
      </div>
    </div>
    
    <div class="sidebar">
      <div class="trigger" data-loc="locationA"> Loc A
      </div>
      <div class="trigger" data-loc="locationB"> Loc B
      </div>
      <div class="trigger" data-loc="locationC"> Loc C
      </div>
      <div class="trigger" data-loc="locationD"> Loc D
      </div>
    <div>
    

    Then with jQuery:

    $(".trigger").hover(function(){
       $("#" + $(this).data("loc") + " .tooltip").fadeIn();
    }, function(){
       $("#" + $(this).data("loc") + " .tooltip").fadeOut();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in the process of creating an interactive campus map using the Google Maps
For creating interactive web apps, Silverlight and Jquery (jqueryUI included) are used. Is there
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
I am creating a system of displaying link information in an interactive way using
I am creating a website using JavaScript/ASP.NET/C#/CSS/HTML/Compact SQL server. I have the majority of
I'm trying to build an interactive map using google's map api v3. The idea
I have a shell script and this one is interactive and I am creating
I am using three.js to do some online interactive modelling of geology, and have
I'm creating a interactive map of china and I need to use it in
I am creating an interactive map for a non profit association Friends of Knox

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.