unidragger

WebJar for unidragger

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

unidragger
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

unidragger
WebJar for unidragger
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/metafizzy/unidragger

Download unidragger

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/unidragger/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>unidragger</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/unidragger/
implementation 'org.webjars.bower:unidragger:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.bower/unidragger/
implementation ("org.webjars.bower:unidragger:2.1.0")
'org.webjars.bower:unidragger:jar:2.1.0'
<dependency org="org.webjars.bower" name="unidragger" rev="2.1.0">
  <artifact name="unidragger" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='unidragger', version='2.1.0')
)
libraryDependencies += "org.webjars.bower" % "unidragger" % "2.1.0"
[org.webjars.bower/unidragger "2.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : unipointer jar [2.1.0,2.2)

Project Modules

There are no modules declared in this project.

Unidragger

Base draggable class

Used in Flickity and Draggabilly.

Unidragger handles all the event binding and handling to support a draggable library.

Features

  • Touch device support: iOS, Android, Microsoft Surface
  • Handles click events in input elements

Install

Bower: bower install unidragger --save

npm: npm install unidragger --save

Demo code

// your draggable class
function Dragger( elem ) {
  this.element = elem;
}

// use Unidragger as a mixin
extend( Dragger.prototype, Unidragger.prototype );

Dragger.prototype.create = function() {
  // set drag handles
  this.handles = [ this.element ];
  this.bindHandles();
};

Dragger.prototype.dragStart = function( event, pointer ) {
  console.log('drag start');
};

Dragger.prototype.dragMove = function( event, pointer, moveVector ) {
  var dragX = this.dragStartPoint.x + moveVector.x;
  var dragY = this.dragStartPoint.y + moveVector.y;
  this.element.style.left = dragX + 'px';
  this.element.style.top = dragY + 'px';
};

Dragger.prototype.dragEnd = function( event, pointer ) {
  console.log('drag end');
};

MIT license

By Metafizzy ๐ŸŒˆ ๐Ÿป

org.webjars.bower

Metafizzy

Delightful JS plugins

Versions

Version
2.1.0