New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@autots/dragable

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@autots/dragable

a dragable lib

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

Dragable

a dragable lib to let a HTMLElement to be dragable in a container.

Features

  • typescript features & vanilla js
  • support ie9+

Installing

Using npm:

$ npm install @autots/dragable -S

Using yarn:

$ yarn add @autots/dragable

Example

layouts

<section id="demo1">
  <div class="child1">drag area</div>
</section>

<section id="limit-container">
  <div id="demo2">
    <div class="child2">drag area1</div>
    <div class="child2">drag area2</div>
    <div class="child2">drag area3</div>
  </div>
</section>

import as a module

import Dragable from '@autots/dragable';

// 1. The simplest way
new Dragable('#demo1');

// 2. use config
new Dragable('#demo2', {
  container: '#limit-container', // default is window
  dragArea: '.child2',
  zIndex: 100, // default is 999;
})

import as a lib

<script src="dist/dragable.min.js"></script>

<script>
  var dragableDemo = new AutoTs.Dragable(el, config);
</script>

Config

NameTypeDefaultOptionalDescription
elstring-falsethe element can be dragged
config.containerwindow | stringwindowtruethe container where the el can move
config.dragAreastringdefault equals eltruethe elements which can trigger drag behavior
config.zIndexnumber999truethe css attr 'z-index' added to el

Keywords

dragable

FAQs

Package last updated on 17 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts