Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
browserify module to turn any elment into an XY + cursor input
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.npmignore
Makefile
README.md
cursor.js
index.js
package.json

README.md

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.

Something went wrong with that request. Please try again.