trait SnapOptions extends Object

Using the snap option while dragging, The coordinates of the pointer that the drag event listeners receive will be modified to meet the coordinates of the snap targets. This option can also be used with resizable targets, but may not yield intuitive results. The snapSize option is specifically for snapping the dimensions of targets when resizing. With both snap and snapSize, the snapping targets is an array of objects and functions. There are more options listed below.

Annotations
@JSType()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SnapOptions
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. val endOnly: UndefOr[Boolean]

    The endOnly option is used to snap just before the end of a drag or resize.

    The endOnly option is used to snap just before the end of a drag or resize. Before the end event is fired, an extra <action>move event is snapped and fired.

    If inertia is enabled and endOnly is set to true then the pointer will follow a curve to the snap target.

    Annotations
    @JSOptional()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  17. val offset: UndefOr[Point]

    A snap offsets lets you shift the coordinates of all snap targets by the x and y properties of a given object or if the string 'startCoords' is given, then pageX and pageY at the start of the action are used.

    A snap offsets lets you shift the coordinates of all snap targets by the x and y properties of a given object or if the string 'startCoords' is given, then pageX and pageY at the start of the action are used.

    Annotations
    @JSOptional()
  18. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  19. val range: UndefOr[Double]

    The range of a snap target is the distance the pointer must be from the target’s coordinates for a snap to be possible.

    The range of a snap target is the distance the pointer must be from the target’s coordinates for a snap to be possible.

    i.e. inRange = distance <= range.

    If a snap target doesn’t have it’s own range, the default range is used.

    Annotations
    @JSOptional()
  20. val relatvePoints: UndefOr[Seq[Point]]

    If you want to specify for snap (not snapSize) the points on the element which snapping should be relative to, then use an array of relativePoints.

    If you want to specify for snap (not snapSize) the points on the element which snapping should be relative to, then use an array of relativePoints. Each item in the array should be an object with x and y properties which are scalars specifying the position on the element to which snapping should be relative. If no relativePoints array is specified or the array is empty then snapping is relative to the pointer coordinates (default).

    There are effectively targets.length * max( relativePoints.length, 1 ) snap targets while snap calculations are done. Snap functions are called multiple times with the coordinates of each relativePoint.

    Annotations
    @JSOptional()
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. val targets: UndefOr[Seq[|[|[SnapTarget, Function2[Double, Double, SnapTarget]], SnapTargetGrid]]]

    The elements of this array can be any combination of points and functions which return points to snap to.

    The elements of this array can be any combination of points and functions which return points to snap to. If there are multiple snap targets, then the nearest snap target that is in range is used.

    POINT TARGETS A snap target can be an object with x, y and range properties. snapSize targets may have either width and height, or x and y. If a target specifies a coordinate in only one axis then snapping will be on a line.

    If a target is defined as { y: 100, range Infinity } then the snapped movement will be horizontal at (100, pageX).

    FUNCTION TARGETS If a snap target is a function, then it called and given the pageX and pageY coordinates of the event. If the function returns an object, that function is used like a point target.

    SNAP GRIDS Use the interact.createSnapGrid method to create a target that snaps to a grid. The method takes an object describing a grid and returns a function that snaps to the corners of that grid.

    The properties of the grid are: x, y – the spacing between the horizontal and vertical grid lines. range – (optional) the distance from the grid corners within which the pointer coords will be snapped. offset – (optional) an object with x and y props to offset the grid lines

    Annotations
    @JSOptional()
  23. def toLocaleString(): String
    Definition Classes
    Object
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. def valueOf(): Any
    Definition Classes
    Object
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped