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

  • Home
  • SEARCH
  • 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 6009931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:02:34+00:00 2026-05-23T02:02:34+00:00

I realize I’m still pretty new here, but I have a static image (Google

  • 0

I realize I’m still pretty new here, but I have a static image (Google Map but not using Google API yet) in which I have created hotspots which will pull up location data that lives in a table to the left of the map. When a hotspot is clicked on, however, the page scrolls down so that the top of the map (the image map) is at the top of the screen even though the information is directly beside the map.

I am assuming this is because the anchor is seeking to load at the top of the screen. This would be okay except that my header is now pushed out of the screen. Is there a way for the page to not “move” when the hotspot is clicked?

The page can be seen here: http://www.mydillonsupply.com/default.aspx?page=customer&file=customer/disupp/customerpages/locations_page.htm

  • 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-23T02:02:35+00:00Added an answer on May 23, 2026 at 2:02 am

    Instead of using the default browser behavior (for anchor tags) just block it, and scroll the box yourself. I can see you are already using jQuery. So something like this ought to do the trick.

    $('area').bind('click', function(e) {
        e.preventDefault();
        // the div in question has nothing uniquely identifiable as it is now,
        // assign it a unqie class or id so you can select it
       var findAnchor=this.href.split('#')[1];
        $('#the_div').scrollTop($('a[name="' + findAnchor+'"]').next().position().top);
    });
    

    It’s kinda hard to test in the context of that page, but if you set up a fiddle with just that part of it I am sure this could be made to work right pretty easily.

    (edit) – OP set up a fiddle with the problem, updated version here:

    http://jsfiddle.net/H3Mz6/9/

    The code above has been updated to reflect what actually works. I also added the id “the_div” to the div surrounding the table of locations. Here’s how it works:

    1) get the part of the href after the # – the browser may add the full url.
    2) find it, then get the next() element, because the invisible anchor tags will report that they have no location information
    3) then get the position().top value which is the postion of that element relative to it’s container
    4) then scrollTop(..) to it


    Contrary to @colinross’s suggestion, there’s nothing that’s either non-extensible nor inflexible about imagemaps. Quite the opposite, they are the only way you can have irregularly shaped hotspots without going to a heck of a lot of trouble, and that gives you a lot of power. All you need to do to make them do whatever you want is bind your own mouseover and/or click events to the areas, and call e.preventDefault(). It’s all yours from there.

    Yes, I like image maps, and I also wrote a plugin that does a heck of a lot with them. So I am fairly biased. But I am surprised by the trouble people go to in order to avoid them (like absolutely positioning anchor links, complex css, and so on) when they’re dead simple, easy to use, work with every browser under the sun, and are far more powerful than positioning all your hotspots by hand. (And without an imagemap, or some crazy logic to figure out where the mouse is on your own, you’re limited to rectangular areas anyway!).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realize that this is not possible since Android doesnt have a JVM but
I realize this question is pretty basic, but I'm really stuck. I have a
I realize this may be a simple problem, but I am new to ASP.net
I realize I can get the iterator reference by calling back() but why not
I realize this is fairly abstract, but I'd like to do something not unlike
I realize this is not necessarily the smartest way to do this, but now
I realize this might not be the best setup, but humor me, is it
I realize this perhaps a naive question but still I cant figure out how
I realize that PHP does not support unsigned integers, but I'm wondering how to
I realize that there was a similar question asked here , but this is

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.