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

Last change on this file since 217 was 133, checked in by David Sheldon, 15 years ago

Might be a fix for ticket:34, also made the report bug page more clear about its broken state.

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