JSPM

fffield

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q23025F
  • License MIT

given a dom element, turn it into a X/Y cursor input

Package Exports

  • fffield

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fffield) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.