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

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

Replace links to map.html to use # rather than ? to prepresent the params.

This fixes the back button (ticket:33).

File size: 809 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">
20var xOffset = 124;
21
22function click(e) {
23       
24  e = YAHOO.util.Event.getEvent(e);
25  var img = YAHOO.util.Event.getTarget(e);
26        var x = xOffset + YAHOO.util.Event.getPageX(e) - img.offsetLeft;
27        var y = img.height-(YAHOO.util.Event.getPageY(e) - img.offsetTop);
28
29        var s6x = Math.round(x/6);
30        var s6y = Math.round(y/6);
31
32        window.location=("map.html#" + s6x + "," + s6y + ",3");
33
34        YAHOO.util.Event.stopEvent(e);
35}
36
37  YAHOO.util.Event.addListener("link", "click", click);
38
39</script>
40
41</html>
Note: See TracBrowser for help on using the repository browser.