Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ev-pos

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ev-pos

relative position of mouse/touch events to element

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
increased by1.66%
Maintainers
1
Weekly downloads
 
Created
Source

ev-pos

stable

relative position of mouse/touch events to element

Usage

npm i ev-pos

NPM

var evPos = require('ev-pos');

document.querySelector('.some-element').addEventListener('click', function(ev){
    //position relative to ev.currentTarget
    var p1 = evPos(ev);
    //position relative to document.body
    var p2 = evPos(ev, document.body);
});

API

evPos(event, [toElement])

toElement defaults to ev.currentTarget

Example

npm i && npm run test-visual

(expects beefy to be installed globally)

Licence

MIT, see LICENSE.md for details.

Keywords

FAQs

Package last updated on 14 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc