Documentation

UI/API/1.6/Draggable

From jQuery JavaScript Library

Jump to: navigation, search

This is an old version of the Draggable API:
View the Current API

« Back to the jQuery UI Docs

NameType
Dependencies:

  • ui.core.js

NameType

NameType
Plugin methods:UI/API/1.6/Draggable/draggable

NameType

NameType
Example:
Makes the div draggable.

$(".block").draggable();

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="http://code.jquery.com/jquery-1.2.6.js"></script>
  
  <script src="http://ui.jquery.com/latest/ui/ui.core.js"></script>
  <script src="http://ui.jquery.com/latest/ui/ui.draggable.js"></script>

  <script>
  $(document).ready(function(){
    $(".block").draggable();
  });
  </script>
  <style>
  .block { 
    border: 2px solid #0090DF;
    background-color: #68BFEF;
    width: 150px; 
    height: 70px;
    margin: 10px; 
  }
  </style>
</head>
<body>
  <div class="block"></div>
</body>
</html>

NameType