Image map shape : Image Map : HTML JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » HTML » Image Map »

 

Image map shape



    
<html>
<head>
<script language="JavaScript">
    function function1() {
        document.all.area1.coords = "0, 0, 100, 50";
    }
    function function2() {
        document.all.area2.coords = "100, 0, 200, 50"
        document.all.area2.noHref = 'true';
    }
    function function3() {
        document.all.area3.coords = "0, 50, 100, 100";
    }
    function function4() {
        document.all.area4.coords = "100, 50, 200, 100";
    }
    function function5() {
        document.getElementById("area1").coords = "0, 0, 0, 0";
        document.getElementById("area2").coords = "0, 0, 0, 0";
        document.getElementById("area3").coords = "0, 0, 0, 0";
        document.getElementById("area4").coords = "0, 0, 0, 0";
    }
</script>
</head>
<body>
<img src="http://www.navioo.com/style/logo.png" id="myImg" alt="" width="200" height="100" usemap="#myMap2"
<map name="myMap2"
    <area id="area1" 
          shape="rect" 
          href="http://www.navioo.com" 
          alt="navioo.com" 
          onClick="return false">
    <area id="area2" 
          shape="rect" 
          href="http://www.navioo.com" nohref="true" 
          alt="navioo.com home page" 
          onClick="return false">
    <area id="area3" 
          shape="rect" 
          href="http://www.navioo.com" 
          alt="navioo home page" 
          onClick="return false">
    <area id="area4" 
          shape="rect" 
          href="http://www.navioo.com" 
          alt="navioo.com" 
          onClick="return false">
</map>
<br>
<input type="button" value="Make area 1 active" onClick="function1();">
<input type="button" value="Make area 2 active" onClick="function2();">
<input type="button" value="Make area 3 active" onClick="function3();">
<input type="button" value="Make area 4 active" onClick="function4();">
<button onclick="function5();">Restore areas to inactive</button>
<button onclick="alert(myImg.isMap);">IS MAP</button>
<button onclick="alert(area2.noHref);">noHref for Area 2</button>
</body>
</html

    
      
      



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo HTML
» Image Map