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
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<title></title>
</head>
<body>
<div id="a">
</div>
<script type="text/javascript">
var wReel = 100;
var hReel = 200;
var cible = "a";
var nom = "truc";
var map = document.createElement("div");
map.id = cible+"_map";
map.style.position = "absolute";
map.style.zIndex = 3;
map.style.top = 0;
map.style.left = 0;
map.style.margin = 0;
map.style.padding = 0;
map.style.width = wReel;
map.style.height = hReel;
// Cree la zone "suivante"
var area = document.createElement("a");
area.id = "areaSuiv";
area.setAttribute("style", "");
area.style.position = "absolute";
area.style.zIndex = 3;
area.style.top = 0;
area.style.left = Math.floor(wReel/2)+"px";
area.style.width = Math.floor(wReel/2)+"px";
area.style.height = hReel+"px";
area.style.backgroundColor = "#000FFF";
area.setAttribute("onclick", "javascript:alert('"+cible+"');");
area.setAttribute("onmouseover", "javascript:alert('"+cible+"_suivant');");
map.appendChild(area);
document.getElementById("a").appendChild(map);
</script>
</body>
</html> |
Partager