source: trunk/npemap.org.uk/static/tiles/allmaps.html @ 59

Last change on this file since 59 was 59, checked in by David Sheldon, 13 years ago

Now works in IE

File size: 779 bytes
Line 
1
2<html>
3<head>
4  <title>England and Wales maps</title>
5</head>
6<script src="yahoo.js"></script> 
7<script src="dom.js"></script> 
8<script src="event.js"></script> 
9
10<body>
11<p>
12Click on the map to zoom in.
13</p>
14<a href="#" id="link">
15<img src="thumbnail.jpg" style="border: none" />
16</a>
17</body>
18
19<script type="text/javascript">
20function click(e) {
21       
22  e = YAHOO.util.Event.getEvent(e);
23  var img = YAHOO.util.Event.getTarget(e);
24        var x = YAHOO.util.Event.getPageX(e) - img.offsetLeft;
25        var y = img.height-(YAHOO.util.Event.getPageY(e) - img.offsetTop);
26
27        var s6x = Math.round(x/6);
28        var s6y = Math.round(y/6);
29
30        window.location=("map.html?" + s6x + "," + s6y + ",3");
31
32        YAHOO.util.Event.stopEvent(e);
33}
34
35  YAHOO.util.Event.addListener("link", "click", click);
36
37</script>
38
39</html>
Note: See TracBrowser for help on using the repository browser.