JavaScript
Article

jQueryUI Draggable Div Example

By Sam Deering

jQuery code snippet to load jQueryUI and then make a div draggable by using the jQueryUI draggable() function.

google.load("jquery", "1");
google.load("jqueryui", "1");

function OnLoad(){
  $('#content').html('
' + '
dragme
content
'); $("#draggable-handle-div").draggable({ "handle": "div" }); } google.setOnLoadCallback(OnLoad);

No Reader comments

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in JavaScript, once a week, for free.