Image Map Event Handling : Image Map : HTML : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP


JavaScript DHTML  »  HTML   » [  Image Map  ]   
 



Image Map Event Handling

Please note that some example is only working under IE or Firefox.


/*
Mastering JavaScript, Premium Edition
by James Jaworski 

ISBN:078212819X
Publisher Sybex CopyRight 2001
*/
<HTML>
<HEAD>
<TITLE>Image Map Event Handling</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
firstTimeOnHead=true
function onHead() {
 if(firstTimeOnHead) {
  alert("You're on my head!")
  firstTimeOnHead=false
 }
}
function myEye() {
 alert("Be careful or you'll poke out my eye!")
}
function myNose() {
 alert("Aaacchhooo!")
}
function myMouth() {
 alert("Get out of my mouth!")
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<H1>Image Map Event Handling</H1>
<IMG SRC="http://www.java2s.com/style/logo.png" USEMAP="#blockman">
<MAP NAME="blockman">
<AREA COORDS="80,88,120,125" HREF="ch04-10.htm"
onMouseOver="myEye()">
<AREA COORDS="169,88,208,125" HREF="ch04-10.htm"
onMouseOver="myEye()">
<AREA COORDS="124,147,165,181" HREF="ch04-10.htm"
onMouseOut="myNose()">
<AREA COORDS="92,210,192,228" HREF="ch04-10.htm"
onMouseOut="myMouth()">
<AREA COORDS="6,4,292,266" HREF="ch04-10.htm"
onMouseOver="onHead()">
</MAP>
</BODY>
</HTML>

           
       
Related examples in the same category
1.  Image map shape
2.  'coords' Example
3.  'noHref' Example
4.  isMap and useMap Example
5.  Creating the Image Map
6.  Methods and Properties of the Area Object
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.