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

create-point-cb

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-point-cb

Create a point from a DOM event

  • 1.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

create-point-cb

Install

npm install --save create-point-cb

Usage

var createPointCB = require('create-point-cb'),
    myPoint = {},
    pointCB = createPointCB(myPoint);

window.addEventListener('mousemove', pointCB, false);
window.addEventListener('touchmove', pointCB, false);

About

Any object you pass to createPointCB will get these properties:

  • x (the document window x coordinate)
  • y (the document window y coordinate)
  • target (the current event.target)
  • element (this value inside the event callback)
  • pageX (the event.pageX value)
  • pageY (thie event.pageY value)
  • type (the event.type)

Use create-point-cb with any DOM event that will have clientX, or clientY properties. This usually would be mousemove, or the touchmove event on the window object.

Happy coding. :)

Keywords

FAQs

Package last updated on 17 Nov 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