u1ui / PointerObserver.js

Observe mouse and touches

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PointerObserver.js

Observe mouse and touches

Ussage

import {PointerObserver} from "../PointerObserver.js";
new PointerObserver(el).onmove = function(e){
    console.log(this.pos);
}
<div id=el style="position:absolute;">
    StartObserving
</div>

doc

Install

import * as module from "https://cdn.jsdelivr.net/gh/u1ui/PointerObserver.js@x.x.x/PointerObserver.min.js"

Demos

minimal.html
test.html

About

  • MIT License, Copyright (c) 2022 (like all repositories in this organization)
  • Suggestions, ideas, finding bugs and making pull requests make us very happy. ♥

About

Observe mouse and touches


Languages

Language:JavaScript 59.7%Language:HTML 40.3%