Link Search Menu Expand Document

Draggable

boost.js/src/draggable.ts#L34

Class Draggable

A draggable HTML element.

Extends EventTarget

constructor ($el: ElementView, $parent: ElementView, options: DraggableOptions): Draggable

Name Type Default Description
$el ElementView    
$parent ElementView    
options DraggableOptions  

readonly Property .$el : ElementView

Property .disabled : boolean

Default value: false

Property .height : number

Default value: 0

Property .options : DraggableOptions

Property .position : Point

Default value: ...

Property .width : number

Default value: 0

Method .off (events: string, fn: EventCallback): void

Removes an event listener from one or more events.

Name Type Default Description
events string    
fn EventCallback    

Method .on (events: string, fn: EventCallback): void

Adds an event listener for one or more events.

Name Type Default Description
events string    
fn EventCallback    

Method .one (events: string, fn: EventCallback): void

Adds a one-time event listener to one or more events.

Name Type Default Description
events string    
fn EventCallback    

Method .setDimensions ($parent: ElementView): void

Name Type Default Description
$parent ElementView    

Method .setPosition (x: number, y: number): void

Sets the position of the element.

Name Type Default Description
x number    
y number    

Method .trigger (events: string, arg: any): void

Triggers one or more events, and executes all bound event listeners.

Name Type Default Description
events string    
arg any    

Copyright © 2021 Mathigon.org