Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bomsy/dragdrop
A small javascript dragdrop library that handles drag n drop and let you focus on implementation details
https://github.com/bomsy/dragdrop
Last synced: about 1 month ago
JSON representation
A small javascript dragdrop library that handles drag n drop and let you focus on implementation details
- Host: GitHub
- URL: https://github.com/bomsy/dragdrop
- Owner: bomsy
- Created: 2012-04-22T22:00:04.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-05-22T16:24:34.000Z (over 12 years ago)
- Last Synced: 2023-03-23T12:55:13.328Z (over 1 year ago)
- Size: 125 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
dragdropjs
==========
A small javascript library that handles drag n drop, letting you focus on your implementation details
Aim to ease the difficulties in implementing drag n drop.
## Progress
Still under development
## Cross browser support
Currently supports ie7+, chrome, firefox, opera and safari.
## Loading the javscript file(function(d){
if(d.getElementById(id)) {
var js,
id = "dragdrop-js",
ref = d.getElementsByTagName('script')[0];
js = d.createElement("script");
js.id = id;
js.type = "text/javascript";
js.src = "/js/dragdrop/dragdrop.js";
js.async = false;
js.onreadystatechange = function () {
if (js.readyState === "loaded" || js.readyState === "complete") {
js.onreadystatechange = null;
DRAGDROP.onDragBegin = function (dragElement) {
//your code to run on drag begin
};
DRAGDROP.onDrag = function (elementBelow, dragElement) {
//your code to run on drag
};
DRAGDROP.onDrop = function (dropElement, dragElement) {
//your code to run on drop
};
}
}
ref.parentNode.insertBefore(js, ref);
}
})(document)
## Examples