Namely, Pickled Meatballs
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

fffield

0.0.1 • Public • Published

fffield

Turn any dom element into an X/Y input with a cursor.

 
var field = require('fffield')
 
var target = $('#my-target')
 
field(target, 0, 0)
  .on('data', function(position) {
    console.log(position.x, position.y) // bounded from 0.0 to 1.0
  })
 

API

field = require('fffield')

field(jquery element, initial x, initial y[, optional cursor constructor]) -> Field instance

Events

'data' -> {x, y}

Data events are emitted whenever the cursor changes positions.

Keywords

none

install

npm i fffield

Downloadsweekly downloads

2

version

0.0.1

license

none

repository

githubgithub

last publish

collaborators

  • avatar