Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery EasyUI Drag and Drop - Basic Dragging and Dropping

jQuery EasyUI Drag and Drop - Basic Dragging and Dropping

This tutorial shows you how to make HTML elements draggable. In this example, we will create three DIV elements and then enable dragging and dropping on them.

First, we create three

element:



    
    
    

For the first

element, we make it draggable using the default settings.



    $('#dd1').draggable();

For the second

element, we make it draggable by creating a proxy that is a clone of the original element.



    $('#dd2').draggable({

        proxy:'clone'

    });

For the third

element, we make it draggable by creating a custom proxy.



    $('#dd3').draggable({

        proxy:function(source){

            var p = $('
proxy
');             p.appendTo('body');             return p;         }     });

Download the jQuery EasyUI example

jeasyui-dd-basic.zip