Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Onmouseover light ups with an image map.

Posted on 1999-07-07
Medium Priority
Last Modified: 2008-02-01
I would like an image to change when the mouse moves over a certain section. I would do this with multiple images, but it is a pie chart style menu. Therefore, if the mouse is over a certain section of the picture, change the picture to this...

Question by:dleslie
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

Intergnat earned 400 total points
ID: 1288858
Easily done with an image map.  Create hotzones (i.e., the <AREA> tags) that correspond to your pie wedges.  For each <AREA>, set up an "onMouseOver" event handler that swaps in a new graphic with the desired wedge highlighted.

Note that you're swapping in an entire copy of the image.  This is necessary because (as you noted) HTML can only tile rectangular image segments together into an apparent whole image.  By swapping the whole image, you can get the effect you want.  

Remember that each image (one for each highlighted pie wedge), should have the same dimensions, so that the <AREA>s match up, regardless of which image is currently showing.

I suggest you preload the images, to improve the performance.  However, the topic of image preloading is beyond the scope of your question.
LVL 11

Expert Comment

ID: 1288859
Do you mean something like the following URL?:

Let me know if you want help implementing...


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question