Home arrow HTML arrow Page 5 - Another Look at Animation of Geographical Map Regions
HTML

Another Look at Animation of Geographical Map Regions


We finished the last article with unanswered questions about the onmouseover and onmouseout events for a blinking map region. When does the event actually occur? And what event specifically is occurring? We will answer these questions and more in this article, so join us for the exciting conclusion.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
June 23, 2008
TABLE OF CONTENTS:
  1. · Another Look at Animation of Geographical Map Regions
  2. · How to Stop the Blinking
  3. · Complete Code
  4. · Code continued
  5. · More Code

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Another Look at Animation of Geographical Map Regions - More Code
(Page 5 of 5 )


<area onmouseover="startTogglingPortugal()" href ="moreOnPortugal.htm" alt="Click to know more about tourism in Portugal" shape ="poly" coords ="21,317,19,323,21,329,20,331,19,330,18,334,13,343,10,346,8,350,9,
356, 11,356,10,360,10,365,7,369,10,372,15,372,17,375,20,373,20,368,
25,363,25, 358,27,354,26,351,26,348,27,346,30,344,33,338,33,336,33,
333,33,332,37,331, 39,329,39,328,38,326,37,324,35,324,34,323,31,324,
28,322,27,322,26,319,23, 319">

<area onmouseover="startTogglingSpain()" href ="moreOnSpain.htm" alt="Click to know more about tourism in Spain" shape ="poly" coords ="21,319,26,319,26,322,30,322,32,322,38,325,40,328,38,330,33,333,31, 344,26,348,27,353,23,359,26,363,22,366,20,371,24,374,26,376,28,383,
32,390, 37,384,42,384,44,383,48,383,51,384,55,384,58,387,60,385,63,
387,71,379,76, 379,78,373,87,368,84,366,84,366,83,359,83,357,94,346,
96,344,105,343,109,341,112,338,116,333,113,331,106,331,102,328,97,
325,93,326,89,325,86,323,84,321,82,320,78,316,74,316,68,315,65,312,
58,312,56,312,47,308,43,308,40,306,37,306,35,304,31,303,27,307,23,
306,19,309,21,312,22,314,21,318">

<area onmouseover="startTogglingFrance()" href ="moreOnFrance.htm" alt="Click to know more about tourism in France" shape ="poly" coords ="77,316,82,320,86,322,88,323,91,325,95,324,102,327,105,330,112,
331,113, 325,117,323,120,320,123,319,127,321,131,326,138,326,139,
326,143,323,146,319,148,318,149,316,145,315,144,312,144,308,141,
304,145,302,145,299,145,296,143,291,141,291,140,292,138,294,139,291,
140,288,141,285,144,282,145,280,147,280,149,276,149,272,150,268,153,
265,153,264,149,263,146,261,141,258,136,258,132,254,128,252,127,251,
120,251,121,246,122,245,119,243,119,241,117,240,115,240,112,241,111,
247,109,250,105,251,101,254,100,256,97,255,91,253,90,251,88,252,88,
254,88,258,85,260,80,259,78,257,74,255,72,255,71,255,69,258,69,263,
67,266,2,267,75,271,79,272,82,276,84,286,85,293,85,300,82,308,79,313,
78,316">

<area onmouseover="resetAll()" shape ="poly" coords ="7,369,23,373,34,387,48,384,63,387,76,379,86,368,83,359,97,343,
113,337, 117,322,130,320,137,325,150,317,146,312,143,304,146,297,
144,291,140,291,149,280,153,264,127,249,123,249,122,244,115,239,
109,249,99,253,88,249,87,259,71,254,67,264,77,272,85,287,84,297,77,
315,65,312,46,309,33,302,21,304,21,319,20,328,12,345,6,350,11,356,9,
367,2,366,2,1,324,4,323,418,2,417,2,366,6,369">

</map>

<img src="Spain.jpg" usemap ="#MS" id="Spain">

<map id="MS">

<area onmouseover="startTogglingPortugal()" href ="moreOnPortugal.htm" alt="Click to know more about tourism in Portugal" shape ="poly" coords ="21,317,19,323,21,329,20,331,19,330,18,334,13,343,10,346,8,350,
9,356,11, 356,10,360,10,365,7,369,10,372,15,372,17,375,20,373,20,
368,25,363,25,358,27,354,26,351,26,348,27,346,30,344,33,338,33,336,
33,333,33,332,37,331,39,329,39,328,38,326,37,324,35,324,34,323,31,
324,28,322,27,322,26,319,23,319">

<area onmouseover="startTogglingSpain()" href ="moreOnSpain.htm" alt="Click to know more about tourism in Spain" shape ="poly" coords ="21,319,26,319,26,322,30,322,32,322,38,325,40,328,38,330,33,333,
31,344, 26,348,27,353,23,359,26,363,22,366,20,371,24,374,26,376,28,
383,32,390,37,384, 42,384,44,383,48,383,51,384,55,384,58,387,60,385,
63,387,71,379,76,379,78,373,87,368,84,366,84,366,83,359,83,357,94,
346,96,344,105,343,109,341,112,338,116,333,113,331,106,331,102,328,
97,325,93,326,89,325,86,323,84,321,82,320,78,316,74,316,68,315,65,
312,58,312,56,312,47,308,43,308,40,306,37,306,35,304,31,303,27,307,
23,306,19,309,21,312,22,314,21,318">

<area onmouseover="startTogglingFrance()" href ="moreOnFrance.htm" alt="Click to know more about tourism in France" shape ="poly" coords ="77,316,82,320,86,322,88,323,91,325,95,324,102,327,105,330,112,
331,113, 325,117,323,120,320,123,319,127,321,131,326,138,326,139,
326,143,323,146,319,148,318,149,316,145,315,144,312,144,308,141,
304,145,302,145,299,145,296,143,291,141,291,140,292,138,294,139,
291,140,288,141,285,144,282,145,280,147,280,149,276,149,272,150,
268,153,265,153,264,149,263,146,261,141,258,136,258,132,254,128,
252,127,251,120,251,121,246,122,245,119,243,119,241,117,240,115,
240,112,241,111,247,109,250,105,251,101,254,100,256,97,255,91,253,
90,251,88,252,88,254,88,258,85,260,80,259,78,257,74,255,72,255,71,
255,69,258,69,263,67,266,72,267,75,271,79,272,82,276,84,286,85,293,
85,300,82,308,79,313,78,316">

<area onmouseover="resetAll()" shape ="poly" coords ="7,369,23,373,34,387,48,384,63,387,76,379,86,368,83,359,97,343,113,
337, 117,322,130,320,137,325,150,317,146,312,143,304,146,297,144,291,
140,291,149, 280,153,264,127,249,123,249,122,244,115,239,109,249,99,
253,88,249,87,259,71,254,67,264,77,272,85,287,84,297,77,315,65,312,46,
309,33,302,21,304,21,319,20,328,12,345,6,350,11,356,9,367,2,366,2,1,324,
4,323,418,2,417,2,366,6,369">

</map>

<img src="France.jpg" usemap ="#MF" id="France">

<map id="MF">

<area onmouseover="startTogglingPortugal()" href ="moreOnPortugal.htm" alt="Click to know more about tourism in Portugal" shape ="poly" coords ="21,317,19,323,21,329,20,331,19,330,18,334,13,343,10,346,8,350,
9,356, 11,356,10,360,10,365,7,369,10,372,15,372,17,375,20,373,20,
368,25,363,25,358, 27,354,26,351,26,348,27,346,30,344,33,338,33,
336,33,333,33,332,37,331,39,329,39,328,38,326,37,324,35,324,34,
323,31,324,28,322,27,322,26,319,23,319">

<area onmouseover="startTogglingSpain()" href ="moreOnSpain.htm" alt="Click to know more about tourism in Spain" shape ="poly" coords ="21,319,26,319,26,322,30,322,32,322,38,325,40,328,38,330,33,333,
31,344, 26,348,27,353,23,359,26,363,22,366,20,371,24,374,26,376,28,
383,32,390,37,384, 42,384,44,383,48,383,51,384,55,384,58,387,60,385,
63,387,71,379,76,379,78,373,87,368,84,366,84,366,83,359,83,357,94,
346,96,344,105,343,109,341,112,338,116,333,113,331,106,331,102,328,
97,325,93,326,89,325,86,323,84,321,82,320,78,316,74,316,68,315,65,
312,58,312,56,312,47,308,43,308,40,306,37,306,35,304,31,303,27,307,
23,306,19,309,21,312,22,314,21,318">

<area onmouseover="startTogglingFrance()" href ="moreOnFrance.htm" alt="Click to know more about tourism in France" shape ="poly" coords ="77,316,82,320,86,322,88,323,91,325,95,324,102,327,105,330,112,331,
113, 325,117,323,120,320,123,319,127,321,131,326,138,326,139,326,143,
323,146,319, 148,318,149,316,145,315,144,312,144,308,141,304,145,302,
145,299,145,296,143,291,141,291,140,292,138,294,139,291,140,288,141,
285,144,282,145,280,147,280,149,276,149,272,150,268,153,265,153,264,
149,263,146,261,141,258,136,258,132,254,128,252,127,251,120,251,121,
246,122,245,119,243,119,241,117,240,115,240,112,241,111,247,109,250,
105,251,101,254,100,256,97,255,91,253,90,251,88,252,88,254,88,258,85,
260,80,259,78,257,74,255,72,255,71,255,69,258,69,263,67,266,72,267,75,
271,79,272,82,276,84,286,85,293,85,300,82,308,79,313,78,316">

<area onmouseover="resetAll()" shape ="poly" coords ="7,369,23,373,34,387,48,384,63,387,76,379,86,368,83,359,97,343,113,337, 117,322,130,320,137,325,150,317,146,312,143,304,146,297,144,291,140,
291,149,280, 153,264,127,249,123,249,122,244,115,239,109,249,99,253,88,
249,87,259,71,254,67,264,77,272,85,287,84,297,77,315,65,312,46,309,33,
302,21,304,21,319,20,328,12, 345,6,350,11,356,9,367,2,366,2,1,324,4,323,
418,2,417,2,366,6,369">

</map>

<img src="westEuropeMap.jpg" usemap ="#MM" id="initial">

<map id="MM">

<area onmouseover="startTogglingPortugal()" href ="moreOnPortugal.htm" alt="Click to know more about tourism in Portugal" shape ="poly" coords ="21,317,19,323,21,329,20,331,19,330,18,334,13,343,10,346,8,350,9,356,
11, 356,10,360,10,365,7,369,10,372,15,372,17,375,20,373,20,368,25,363,
25,358,27,354, 26,351,26,348,27,346,30,344,33,338,33,336,33,333,33,332,
37,331,39,329,39,328,38, 326,37,324,35,324,34,323,31,324,28,322,27,322,
26,319,23,319">

<area onmouseover="startTogglingSpain()" href ="moreOnSpain.htm" alt="Click to know more about tourism in Spain" shape ="poly" coords ="21,319,26,319,26,322,30,322,32,322,38,325,40,328,38,330,33,333,31,344, 26,348,27,353,23,359,26,363,22,366,20,371,24,374,26,376,28,383,32,390,37,
384, 42,384,44,383,48,383,51,384,55,384,58,387,60,385,63,387,71,379,76,
379,78,373, 87,368,84,366,84,366,83,359,83,357,94,346,96,344,105,343,109,
341,112,338,116, 333,113,331,106,331,102,328,97,325,93,326,89,325,86,323,
84,321,82,320,78,316,74,316,68,315,65,312,58,312,56,312,47,308,43,308,40,
306,37,306,35,304,31,303, 27,307,23,306,19,309,21,312,22,314,21,318">

<area onmouseover="startTogglingFrance()" href ="moreOnFrance.htm" alt="Click to know more about tourism in France" shape ="poly" coords ="77,316,82,320,86,322,88,323,91,325,95,324,102,327,105,330,112,331,113, 325,117,323,120,320,123,319,127,321,131,326,138,326,139,326,143,323,146,
319, 148,318,149,316,145,315,144,312,144,308,141,304,145,302,145,299,145,
296,143, 291,141,291,140,292,138,294,139,291,140,288,141,285,144,282,145,
280,147,280, 149,276,149,272,150,268,153,265,153,264,149,263,146,261,141,
258,136,258,132, 254,128,252,127,251,120,251,121,246,122,245,119,243,119,
241,117,240,115,240,112,241,111,247,109,250,105,251,101,254,100,256,97,
255,91,253,90,251,88,252,88,254,88,258,85,260,80,259,78,257,74,255,72,255,
71,255,69,258,69,263,67,266,72,267,75,271,79,272,82,276,84,286,85,293,85,
300,82,308,79,313,78,316">

<area onmouseover="resetAll()" shape ="poly" coords ="7,369,23,373,34,387,48,384,63,387,76,379,86,368,83,359,97,343,113,337, 117,322,130,320,137,325,150,317,146,312,143,304,146,297,144,291,140,291,
149, 280,153,264,127,249,123,249,122,244,115,239,109,249,99,253,88,249,87,
259,71,254, 67,264,77,272,85,287,84,297,77,315,65,312,46,309,33,302,21,304,
21,319,20,328,12, 345,6,350,11,356,9,367,2,366,2,1,324,4,323,418,2,417,2,
366,6,369">

</map>

</td>

</tr>

</tbody>

</table>


</body>


</html>


Conclusion

One way to give animation to a geographical map image is to put images of different presentations in layers. To animate, change the position of the layers. Producing a blinking (toggling) effect is a delicate process. In the second example, there were two functions for each clickable region. Browsers today do not have features for animating clickable regions in image-maps.

This is a delicate tutorial. That is why I have given two functions for each clickable region. If I did not do this, you would have found the article difficult to understand. Commercial web pages would have many clickable regions, so having two functions for each region would take up too much space. Now that you understand what to do, you can decide whether to have only two functions for all the clickable regions. You will have to use variables (IDs) to identify the different clickable regions.

Also note that the AREA elements for the images with colored regions each have the onmouseover event. Logically, this is not necessary. However, I have included it because of browser limitations.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials