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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:45:21+00:00 2026-05-26T23:45:21+00:00

http://coding.pressbin.com/18/Display-a-Google-Map-when-you-hover-over-location-text/ I am following this tutorial on how to display google map over a

  • 0

http://coding.pressbin.com/18/Display-a-Google-Map-when-you-hover-over-location-text/ I am following this tutorial on how to display google map over a text. Yes it appears but in a wrong place. See, the map is displaying on the bottom of the page. When I hover the map image the div itself has no attributes compared to the working ones.

Working code:

<div style="position: absolute; left: 678px; top: 170px; z-index: 999; display: none; padding: 1px; margin-left: 5px; background-color: rgb(51, 51, 51); width: 302px; box-shadow: 0pt 1px 10px rgba(0, 0, 0, 0.5);">
<a target="new" href="http://maps.google.com/maps?q=Brookhaven, PA&z=11">
<img border="0" src="http://maps.google.com/maps/api/staticmap?center=Brookhaven, PA&zoom=12&size=300x300&sensor=false&format=png&markers=color:blue|Brookhaven, PA">
</a>
</div>

What’s in my browser:

<div style="display: none;">
<a target="new" href="http://maps.google.com/maps?q=4417 Edgmont Avenue, 19015&z=11">
<img border="0" src="http://maps.google.com/maps/api/staticmap?center=4417 Edgmont Avenue, 19015&zoom=16&size=300x300&sensor=false&format=png&markers=color:blue|4417 Edgmont Avenue, 19015">
</a>
</div>

I’m lost on the div part.
Please help!

  • 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-26T23:45:22+00:00Added an answer on May 26, 2026 at 11:45 pm

    This is what works for me:

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <title>jQuery Test Script</title>
    </head>
    <body>
    <span class="mapThis" place="600 Forbes Ave, Pittsburgh, PA 15282" zoom="16">Duquesne University</span> is located in the great town of <span class="mapThis" place="Pittsburgh, PA" zoom="12">Pittsburgh</span> in the great state of <span class="mapThis" place="Pennsylvania" zoom="6">Pennsylvania</span>.
    <script src="jquery-ui-1.8.16.custom/js/jquery-1.6.2.min.js"></script>
    <script src="scripts/test_script.js"></script>
    </body>
    </html>
    

    Here’s the jQuery to make it happen:

    // JavaScript Document
    $(document).ready(function () {
    var cursorX;
    var cursorY;
    if (window.Event) {
      document.captureEvents(Event.MOUSEMOVE);
    }
    document.onmousemove = getCursorXY;
    $(".mapThis").each(function() {
      var dPlace = $(this).attr("place");
      var dZoom = $(this).attr("zoom");
      var dText = $(this).html();
      $(this).html('<a onmouseover="mapThis.show(this);" style="text-decoration:none; border-bottom:1px dotted #999" href="http://maps.google.com/maps?q=' + dPlace + '&z=' + dZoom + '">' + dText + '</a>');
     });
    });
    var mapThis=function(){
    var tt;
    var errorBox;
    return{
      show:function(v){
       if (tt == null) {
       var pNode = v.parentNode;
       pPlace = $(pNode).attr("place");
       pZoom = parseInt($(pNode).attr("zoom"));
       pText = $(v).html();
       tt = document.createElement('div');
       $(tt).html('<a href="http://maps.google.com/maps?q=' + pPlace + '&z=11" target="new"><img border=0 src="http://maps.google.com/maps/api/staticmap?center=' + pPlace + '&zoom=' + pZoom + '&size=300x300&sensor=false&format=png&markers=color:blue|' + pPlace + '"></a>');
       tt.addEventListener('mouseover', function() { mapHover = 1; }, true);
       tt.addEventListener('mouseout', function() { mapHover = 0; }, true);
       tt.addEventListener('mouseout', mapThis.hide, true);
       document.body.appendChild(tt);    
    }
    fromleft = cursorX;
    fromtop = cursorY;
    fromleft = fromleft - 25;
    fromtop = fromtop - 25;
    tt.style.cssText = "position:absolute; left:" + fromleft + "px; top:" + fromtop + "px; z-index:999; display:block; padding:1px; margin-left:5px; background-color:#333; width:302px; -moz-box-shadow:0 1px 10px rgba(0, 0, 0, 0.5);";   
    tt.style.display = 'block';
    },
    hide:function(){
    tt.style.display = 'none';
    tt = null;
    }
     };
    }();
    function getCursorXY(e) {
    cursorX = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
    cursorY = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I followed this tutorial : http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/ and I got the alert 'Text messaging is
I was reading this article on Coding Horror: http://www.codinghorror.com/blog/2008/04/setting-up-subversion-on-windows.html I went to the downloads
I'm adapting the coding style guide from this source: http://www.csharpfriends.com/articles/getarticle.aspx?articleid=336 Under 5.2 Initialization, it
I came across this primer on coding HTML: http://css-tricks.com/examples/CleanCode/Beautiful-HTML.png . Among other things it
$fp = fopen(http://feeds.reuters.com/Reuters/PoliticsNews?format=xml,r) or die(Error reading RSS data.); The above coding working correctly in
http://developer.yahoo.com/javascript/howto-proxy.html Are there disadvantages to this technique? The advantage is obvious, that you can
The coding language is Java. I have a ByteArray embedded in ActionScriptObject.(http://smartfoxserver.com/'>Smartfox Server) I
I have the following coding: <div class=product-top-icons> <div class=energy-rating-1><img src=http://www.justhome.co/skin/frontend/default/just2011/images/assets/<?php echo $_product->getAttributeText('energy_rating_one');?>.jpg></div> <div class=energy-rating-2><img
Im coding a problem(reference --http://www.codechef.com/FEB11/problems/THREECLR/) The below is my code import java.io.*; import java.util.*;
In the PHP Zend Framework coding style: http://framework.zend.com/manual/en/coding-standard.coding-style.html The style for classes and functions

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.