Home arrow HTML arrow Page 4 - 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 - Code continued
(Page 4 of 5 )


//toggle the toggle variable

switch(toggleVarS)

{

case 1:

toggleVarS = 0;

break;

case 0:

toggleVarS = 1;

break;

}

 

 

TS = setTimeout("togglingSpain()",500);

}

 


function startTogglingSpain()

{

mouseHasBeenOverOnceS = mouseHasBeenOverOnceS + 1;

if (mouseHasBeenOverOnceS == 1)

{

togglingSpain()

}

}

 

 

var toggleVarP = 1; //for toggling the initial image and that of Portugal

var mouseHasBeenOverOnceP = 0; //to indicate that mouse pointer has just come over the region of Portugal


function togglingPortugal()

{

clearTimeout(TF)

clearTimeout(TS)

toggleVarF = 1;

toggleVarS = 1;

mouseHasBeenOverOnceF = 0;

mouseHasBeenOverOnceS = 0;

 


switch(toggleVarP)

{

case 1: //the initial image has the highest z-index

 

document.getElementById("initial").style.zIndex = 1;

 

document.getElementById('Portugal').style.zIndex = 2;

document.getElementById('Spain').style.zIndex = 1;

document.getElementById('France').style.zIndex = 1;

break;

case 0: //the image for Portugal has the highest z-index

document.getElementById("initial").style.zIndex = 2;

 

document.getElementById('Portugal').style.zIndex = 1;

document.getElementById('Spain').style.zIndex = 1;

document.getElementById('France').style.zIndex = 1;

break;

}


//toggle the toggle variable

switch(toggleVarP)

{

case 1:

toggleVarP = 0;

break;

case 0:

toggleVarP = 1;

break;

}

 

TP = setTimeout("togglingPortugal()",500);

}

 


function startTogglingPortugal()

{

mouseHasBeenOverOnceP = mouseHasBeenOverOnceP + 1;

if (mouseHasBeenOverOnceP == 1)

{

togglingPortugal()

}

}

 

function resetAll()

{

clearTimeout(TF)

clearTimeout(TS)

clearTimeout(TP)

toggleVarF = 1;

toggleVarS = 1;

toggleVarP = 1;

mouseHasBeenOverOnceF = 0;

mouseHasBeenOverOnceS = 0;

mouseHasBeenOverOnceP = 0;

clearTimeout(TF)

clearTimeout(TS)

clearTimeout(TS)

 

//reset the images

document.getElementById("initial").style.zIndex = 2;

 

document.getElementById('Portugal').style.zIndex = 1;

document.getElementById('Spain').style.zIndex = 1;

document.getElementById('France').style.zIndex = 1;

}


</script>


</head>


<body>


<table cellpadding="0" cellspacing="0" border="0">

<tbody>

<tr>

<td width="100">

</td>

<td id="forMap">

<img src="Portugal.jpg" usemap ="#MP" id="Portugal">

<map id="MP">



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 5 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials