Capítulo 222 de 411
The flexible, recommended way to create Draggable instances (vs. new Draggable()) — accepts a single element, an array, or selector text, and always returns an array of instances (one per element).
| Parameter | Type | Description |
|---|---|---|
| target | Object | element, array of elements, or selector string |
| vars | Object | config like {type: "x,y", inertia: true, edgeResistance: 0.8, onDrag: fn} |
Returns: Array of Draggable instances.
let instances = Draggable.create(".draggable", { type: "x,y", bounds: "#container" });
create() made several.