code: function(e) {
          var posx = 0;
          var posy = 0;
          if (!e) { e = window.event; }
          if (e.type == "MSPointerMove" || e.type == "MSPointerDown" || e.type == "MSPointerUp") {
            return {
              x: e.pageX + window.pageXOffset,
              y: e.pageY + window.pageYOffset
            }
          }
          if (e.pageX || e.pageY) {
              // Good browsers
              return {
                  x: e.pageX,
                  y: e.pageY
              };
          } else if (e.clientX || e.clientY) {
              // Internet Explorer
              return {
                  x: e.clientX,
                  y: e.clientY
              };
          } else if (e.touches && e.touches.length === 1) {
              // Touch browsers
              return {
                  x: e.touches[0].pageX,
                  y: e.touches[0].pageY
              };
          }
      }
docs: From quirksmode: normalize the offset of an event from the top-left of the page.