https://github.com/jnbdz/drag.move.collide
The Drag.Move.Collide class makes it easy to detect when two or more elements collide when dragging an another element.
https://github.com/jnbdz/drag.move.collide
Last synced: 8 months ago
JSON representation
The Drag.Move.Collide class makes it easy to detect when two or more elements collide when dragging an another element.
- Host: GitHub
- URL: https://github.com/jnbdz/drag.move.collide
- Owner: jnbdz
- Created: 2012-04-17T21:30:15.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-04-22T05:53:18.000Z (over 13 years ago)
- Last Synced: 2025-01-10T21:15:38.661Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 146 KB
- Stars: 3
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Drag.Move.Collide
===========The Drag.Move.Collide class makes it easy to detect when two or more elements collide when dragging another element.

How to use
----------Similar to Drag.Move, Drag.Move.Collide needs all of the same informations.
new Drag.Move.Collide(document.id('drag'), {
container: $$('#collision>div')[0],
droppables: $$('#collision .drop'),
onCollide: function(element, droppable){
droppable.setStyle('background', '#E79D35');
},onLeaveCollision: function(element, droppable){
droppable.setStyle('background', '#6B7B95');
},onDrop: function(element, droppable){
if (droppable) droppable.setStyle('background', '#C17878');
}});