Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
The Drag.Move.Collide class makes it easy to detect when two or more elements collide when dragging an another element.
JavaScript
Tag: 0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Demos
Docs
Source
.gitignore
README.md
drag.move.collide.png
package.yml

README.md

Drag.Move.Collide

The Drag.Move.Collide class makes it easy to detect when two or more elements collide when dragging another element.

Screenshot

How to use

Similar to Drag.Move. Drag.Move.Collide needs all 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');
        }

    });
Something went wrong with that request. Please try again.