Class: ElementPressControlMethod

ElementPressControlMethod(element, parameter, velocity, friction)

Set the velocity and friction of a single parameter by pressing and unpressing a DOM element.

Constructor

new ElementPressControlMethod(element, parameter, velocity, friction)

Parameters:
Name Type Description
element Element

Element which activates the method when pressed

parameter String

The parameter to be controlled (e.g. x, y or zoom)

velocity Number

Velocity at which the parameter changes. Use a negative number for opposite direction

friction Number

Friction at which the parameter stops

Implements:

Methods

destroy()

Destroy the instance