HTML
  Home arrow HTML arrow Page 2 - Animation of Geographical Map Regions
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Animation of Geographical Map Regions
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-06-16

    Table of Contents:
  • Animation of Geographical Map Regions
  • Changing the Look of a Region Onmouseover
  • Code
  • Blinking Region Onmouseover

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Animation of Geographical Map Regions - Changing the Look of a Region Onmouseover


    (Page 2 of 4 )

    Here I describe an example for the first case. I use the following image of Western Europe:


    Fig.1. Initial Image of Western Europe

    When the web page is loaded, if you bring the mouse pointer over an image region, a JavaScript function is called to pass the name of the region as an argument. The function will then give the image whose color and text for the region is different the highest z-index value; it will give the image that was foremost a lower z-index value. This will send the initial foremost image behind and bring the targeted one foremost. So it will appear as if the color and text of the image region has changed.

    This is what happens in this example: when the mouse pointer is over the region of Portugal, the region of Portugal becomes blue with the letter P for the word Portugal and with a black border around the region. When the mouse pointer leaves the region of Portugal the initial picture (above) for Portugal reappears. This phenomenon will repeat for the regions of Spain and France.

    To achieve this, you need three other images of Western Europe with the same dimensions: one for Portugal, one for Spain, and one for France. The one for Portugal has a blue region for Portugal with the letter P for the word Portugal and with a black border; the one for Spain has a blue region for Spain with the letter S for the word Spain and with a black border; the one for France has a blue region for France with the letter F for the word France and with a black border.

    The three images are as follows:


    Fig.2. Image for Portugal


    Fig.3. Image for Spain


    Fig.4. Image for France

    I have included these image files with this article, so that you can try the codes yourself.

    When the web page first loads, the initial image is that of fig.1. This image is given an initial z-index value of 2. The other three images are each given a starting z-index value of 1. The BODY element is given a z-index value of 0.

    Each of the above 4 images is an image-map in the HTML code. For each image-map the regions of Portugal, Spain, and France are made clickable. Each of these regions takes the shape of an irregular polygon. In one of my previous articles, I showed you how to obtain the corresponding coordinates. The following page has the complete code; the explanation for the code is given below it.

    More HTML Articles
    More By Chrysanthus Forcha


       · You too can now do it.Chrys
     

    HTML ARTICLES

    - Using a 3D HTML Table as a Recordset
    - Building a 3D HTML Table
    - Maximizing and Restoring HTML Images: Layer ...
    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT