Changeset 59


Ignore:
Timestamp:
Oct 16, 2006, 2:08:02 PM (13 years ago)
Author:
David Sheldon
Message:

Now works in IE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/tiles/allmaps.html

    r58 r59  
    66<script src="yahoo.js"></script>
    77<script src="dom.js"></script>
     8<script src="event.js"></script>
    89
    910<body>
     
    1819<script type="text/javascript">
    1920function click(e) {
    20   e = (e)?e:event;
    21   var img = (e.target)?e.target:e.srcElement;
    22         var x = e.pageX - img.offsetLeft;
    23         var y = img.height-(e.pageY - img.offsetTop);
     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);
    2426
    2527        var s6x = Math.round(x/6);
     
    2830        window.location=("map.html?" + s6x + "," + s6y + ",3");
    2931
    30         return false;
     32        YAHOO.util.Event.stopEvent(e);
    3133}
    3234
    33         var link = document.getElementById("link");
    34 
    35         link.onclick = click;
    36         link.href='#';
     35  YAHOO.util.Event.addListener("link", "click", click);
    3736
    3837</script>
Note: See TracChangeset for help on using the changeset viewer.