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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:21:12+00:00 2026-05-12T12:21:12+00:00

Basically I need this: http://plugins.jquery.com/project/maphilight …but instead of just having the <AREA> tags recieve

  • 0

Basically I need this:

http://plugins.jquery.com/project/maphilight

…but instead of just having the <AREA> tags recieve a border or fill color on rollover, have them recieve a background image. The image needs to be clipped by the shape of the <AREA>s.

Any ideas?

Basically the setup I have is as follows:

<img usemap="#map" />
<map name="map">
  <area coords="foo,bar">
  <area coords="foo,bar">
  <area coords="foo,bar">
</map>

And I want the background image of each AREA tag to change on rollover.

A faux version of what I want is here:

tankedup-imaging. com/css_dev/rollover.html

…except that here, notice this is not a “true” image map, the rollover areas are not really bound by AREA tags.

  • 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-12T12:21:12+00:00Added an answer on May 12, 2026 at 12:21 pm

    OK, my solution.

    Start with an image map like so:

    <img src="nav.jpg" id="main-nav" usemap="#imagemap" />              
    
    <map id="imagemap" name="imagemap">
        <area id="item1" href="item1.shtml" shape="poly" coords="153,52,484,6,492,43,158,74" />
        <area id="item2" href="item2.shtml" shape="poly" coords="95,96,287,84,289,112,95,118,97,118" />
    </map>
    

    Then, I use jQuery to swap the SRC attribute of the IMG when the user hovers over each specific AREA, then return the IMG to the off state on mouseout.

    $(document).ready(function() {
    
    //set off state 
    var nav_off = "/images/nav-off.jpg";
    
    // functions for over and off
    function over(image) {
        $("#main-nav").attr("src", image);
    }
    function off() {
        $("#main-nav").attr("src", nav_off);
    }
    
    $("#imagemap area").hover(
        function () {
            var button = $(this).attr("id");
            over("/images/nav-" + button + ".jpg");
        },
        function () {
            off();
        });
    
    });
    

    This could probably be combined with CSS Sprites somehow, swapping the background-position of some image during rollover.

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

Sidebar

Ask A Question

Stats

  • Questions 244k
  • Answers 244k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I haven't done exactly what you require before, however it's… May 13, 2026 at 8:06 am
  • Editorial Team
    Editorial Team added an answer I cannot see from the link to the xml what… May 13, 2026 at 8:06 am
  • Editorial Team
    Editorial Team added an answer DBViewer looks good (disclaimer: not tested directly) An older one… May 13, 2026 at 8:06 am

Related Questions

Basically I need this: http://plugins.jquery.com/project/maphilight ...but instead of just having the <AREA> tags recieve
on all the speed up your website sites and books they always tell us
This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look
I'm just wondering what do you use for managing visitor requests on your website?
I feel a little bit kind of confused — for about 24 hours I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.