VOOZH about

URL: https://www.geeksforgeeks.org/jquery/jquery-ui-draggable-create-event/

⇱ jQuery UI Draggable create Event - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

jQuery UI Draggable create Event

Last Updated : 23 Jul, 2025

jQuery UI is a web-based technology and consists of GUI widgets, visual effects, and themes implemented using the jQuery, JavaScript Library. jQuery UI is the best tool for building UI interfaces for the webpages. It can also be used to build highly interactive web applications or can be used to add widgets easily.

The jQuery UI Draggable create Event is used to trigger when the draggable is created.

Syntax:

We need to initialize the Draggable widget with the create a callback function:

$( ".selector" ).draggable({
 create : function( event, ui ) {}
});
  • Bind an event listener to the dragcreate an event:

    $( ".selector" ).on( "dragcreate", function( event, ui ) {} );

Parameters: These are the following parameters that are accepted.  

  • event: This event is triggered when the sort creates an item.
  • ui: This parameter is of type object with below-given options.
    • helper: This parameter is the jQuery object representing the sorted helper.
    • item: This parameter is the jQuery object that represents the current dragged item.
    • offset: This parameter is the current absolute position of the helper object which is represented as { top, left }.
    • position: This parameter is the current position of the helper object which is represented as { top, left }.

CDN Link: The following jQuery Mobile scripts will be needed for your project so we need to add these scripts to your project.

<link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel = "stylesheet">
<script src = "https://code.jquery.com/jquery-1.10.2.js"></script>
<script src = "https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

Example: This example describes the uses of the jQuery UI Draggable create Event.

Output:

👁 jQuery UI Draggable create Event
jQuery UI Draggable create Event

Reference: https://api.jqueryui.com/draggable/#event-create

Comment

Explore