File: ImageMap.html

package info (click to toggle)
iceweasel 2.0.0.19-0etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 298,784 kB
  • ctags: 317,912
  • sloc: cpp: 1,796,902; ansic: 987,677; xml: 109,036; makefile: 47,777; asm: 35,201; perl: 26,983; sh: 20,879; cs: 6,232; java: 5,513; python: 3,249; pascal: 459; lex: 306; php: 244; csh: 132; objc: 97; yacc: 79; ada: 49; awk: 14; sql: 4; sed: 4
file content (87 lines) | stat: -rw-r--r-- 2,306 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<HTML>
<head>
<SCRIPT>
function isEmpty(s)
{
  if (null == s) return true;
  if (s.length == 0) return true;
  return false;
}

function dumpMap(map)
{
  dump("<map name=\"" + map.name + "\">\n");
  var areas = map.areas;
  var i;
  for (i = 0; i < areas.length; i++) {
    var area = areas[i];
    var coords = area.coords;
    var shape = area.shape;
    var href = area.href;
    dump("  <area");
    if (!isEmpty(coords)) {
      dump(" coords=\"" + coords + "\"");
    }
    if (!isEmpty(shape)) {
      dump(" shape=\"" + shape + "\"");
    }
    if (!isEmpty(href)) {
      dump(" href=\"" + href + "\"");
    }
    dump(">\n");
  }
  dump("</map>\n");
}

function showMap()
{
  var map = document.getElementById("mainmap");
  dump("Map, before we edit it:\n");
  dumpMap(map);
  return false;
}

function removeArea()
{
  var map = document.getElementById("mainmap");
  map.removeChild(map.areas[0]);
  dump("Map, after we editted it:\n");
  dumpMap(map);
  return true;
}

function addArea()
{
  // remove the first area and then add in a new area
  var map = document.getElementById("mainmap");
  var newArea = document.createElement("area", newArea);
  newArea.setAttribute("COORDS", "385,1,467,24");
  newArea.setAttribute("HREF", "../edemo/democ/index.html");
  map.appendChild(newArea);

  dump("Map, after we editted it:\n");
  dumpMap(map);
  return true;
}
</SCRIPT>
</head>
<BODY>
<IMG SRC="new_nav_home.gif" WIDTH=468 HEIGHT=25 BORDER=50 USEMAP="#mainmap" ALT="Navigation Bar" ISMAP><br>
<A HREF="woofer.gif">
<IMG SRC="new_nav_home.gif" WIDTH=468 HEIGHT=25 BORDER=50 ALT="Navigation Bar" ISMAP></A>
<MAP NAME="mainmap" ID=mainmap>
What should a mother do she wonders?
<AREA COORDS="0,2,75,24" HREF="../edemo/demo1/index.html" ALT="Demo 1">
<AREA COORDS="79,2,156,24" HREF="../edemo/demo2/index.html" ALT="Demo 2">
<AREA COORDS="158,1,232,24" HREF="../edemo/demo5/index.html" ALT="Demo 5">
<AREA COORDS="234,1,312,24" HREF="../edemo/demo9/index.html" ALT="Demo 9">
<AREA COORDS="315,2,382,24" HREF="../edemo/demoa/index.html" ALT="Demo a">
</MAP>
<HR>
<form>
<input type=button onclick="return showMap();" value="Show Map">
<input type=button onclick="return removeArea();" value="Remove Area">
<input type=button onclick="return addArea();" value="Append Area">
</form>
</BODY>
</html>