GithubHelp home page GithubHelp logo

cptplastic / makedraggable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from okaybenji/makedraggable

0.0 1.0 0.0 21 KB

perhaps the simplest library for enabling drag-and-drop on DOM elements

JavaScript 34.76% HTML 65.24%

makedraggable's Introduction

makeDraggable

CHECK OUT THE DEMO!

You've found perhaps the simplest library out there for enabling drag-and-drop on your DOM elements. Just look at these impressive numbers!

  • 1 file
  • 40 lines
  • 1 function
  • 0 dependencies
  • 7 billion potential users

To be honest, you could probably just copy and paste the code. Go ahead, no one's looking.

How To Use It

Make an element draggable with makeDraggable(element).

Handles

There's support for "handles" like title bars.

Make just the top 25 pixels accept dragging: makeDraggable(element, {top: 25})

Make just the top, right corner accept dragging: makeDraggable(element, {top: 25, right: 25})

(Note right now you can't make, e.g., the top and bottom grabbable at the same time. I don't imagine you would want to do that anyway.)

makedraggable's People

Contributors

okaybenji avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.