pageX and pageY not working in IE

    pageX and pageY didn't work in IE browsers as IE missing these attributes so we need to add those manually as it is called it will not give any error. So in IE we have clientX and clientY we are using that to add pageX and pageY to event.
    function fixIEevents(ev) {
      if ( ev.pageX == null && e.clientX != null ) {
        var bd = document.body;
        ev.pageX = ev.clientX + (ev && ev.scrollLeft || bd.scrollLeft || 0);
        ev.pageY = ev.clientY + (ev && ev.scrollTop || bd.scrollTop || 0);
      }
      return e;
    }
    you can call fixing function like this

    event  = fixIEevents(event);
    5
    Average: 5 (1 vote)