1.0.13 • Published 4 years ago

dragpos v1.0.13

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

npm.io npm.io npm.io npm.io npm.io

Dragpos

Dragpos is typescript library. Helps to rearrange the list.

Demo

https://sosisusy.github.io/dragpos/

Getting Started

install

npm i dragpos

import

<script src="dragpos/dist/dragpos.js"></script>
<script>
    const dragpos = new DragPos(element, option)
</script>
import DragPos from "dragpos"
const dragpos = new DragPos(element, option)

example

import DragPos from "dragpos"

// Alignment helper registration for nodes with example class
const dragpos = new DragPos(document.querySelector(".example"), {
    backgroundColor: "#eee"
})

// Existing helpers are not erased and new helpers are added
const e2 = document.getElementById("example2")
dragpos.new({
    ele: e2,
    handler: ".handler",      // selector
    backgroundColor: "#eee",
    onDragEnd: (e, option) => {
        fetch("http://example.com/")
        .then(res => res.text())
        .then(res => console.log(res))
    }
})

method

MethodParams
constructorelement, optionCreate new list helper
newoptionCreate new list helper

option

AttributeType
eleHTMLElement StringSpecifying a list container
groupStringGroup naming
handlerStringAssign handler
backgroundColorStringSpecify background color
fontColorStringSpecify font color
fontSizeNumberSpecify font size
fontFamilyStringSpecify font
animationNumberAnimation rate
ListenerParams
onDragStartEvent, OptionOccurred when the dragging starts
onDragOverEvent, OptionOccurred when the dragging over
onDragEndEvent, OptionOccurred when the dragging ends
onChangeEvent, OptionOccurred when element is changed
1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago