source: trunk/npemap.org.uk/static/tiles/1940s/allmaps.html @ 715

Last change on this file since 715 was 715, checked in by Nick Burch, 10 years ago

Get the browse-by-decade parts of the site working

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1
2<html>
3<head>
4  <title>England and Wales maps from the 1940s</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 on our 1940s maps.
13</p>
14<p>
15For more information, or to view our latest maps, please
16 <a href="/">visit the site homepage</a>.
17</p>
18
19<a href="#" id="link">
20<img src="thumbnail.jpg" style="border: none" />
21</a>
22</body>
23
24<script type="text/javascript">
25// The X offset
26// (The number of pixels that were trimmed from the left of the thumbnail
27//   image, when it was created to start at 0,0)
28var xOffset = 77;
29
30function click(e) {
31       
32  e = YAHOO.util.Event.getEvent(e);
33  var img = YAHOO.util.Event.getTarget(e);
34  var imgPos = YAHOO.util.Dom.getXY(img);
35        var x = xOffset + YAHOO.util.Event.getPageX(e) - imgPos[0];
36        var y = img.height-(YAHOO.util.Event.getPageY(e) - imgPos[1]);
37
38        var s6x = Math.round(x/6);
39        var s6y = Math.round(y/6);
40
41        window.location=("map.html#" + s6x + "," + s6y + ",3");
42
43        YAHOO.util.Event.stopEvent(e);
44}
45
46  YAHOO.util.Event.addListener("link", "click", click);
47
48</script>
49
50</html>
Note: See TracBrowser for help on using the repository browser.