Skip to content
Minimalist pointer events polyfill
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


Minimalist pointer events polyfill.

Contrary to the current standard polyfill for pointer events (jquery/PEP), this polyfill provides relative positions (offsetX and offsetY properties) and is compatible with elm JSON decoders (no cyclic attributes).


Import the elm-pep.js file in your web page. The implemented pointer events are:

  • pointerdown
  • pointermove
  • pointerup

If the PointerEvent API is not supported in the browser, this will attach mouse and touch events to the document. When triggered, it transforms the mouse or touch event into a pointer event and dispatch it.


This is not a fully featured polyfill.

This code is truly minimalist and simple so probably not very computing efficient. It does not aim at supporting old browsers, only recent browsers that do not support pointer events yet.

This code focuses on unifying the touch and mouse APIs and thus only provides the pointerId and isPrimary properties specific to pointer events.


  • Matthieu Pizenberg - @mpizenberg
  • Thomas Forgione - @tforgione
  • Robert Vollmert - @robx (iOS debugging)
You can’t perform that action at this time.