Control.setDraggable

Syntax

setDraggable(value: Boolean);

Parameters

value. Indicates whether a component can be dragged.

Description

The setDraggable method determines whether a component can be dragged on the HTML page.

Comments

Available values of the value parameter:

Example

To execute the example, link the PP.js library and the PP.css visual styles table to HTML page.

Create a button - instance of the Button class.

<div id = "btn1"></div>
<script type="text/javascript">
  var b1 = new PP.Ui.Button({
      Content: "Draggable Button",
      UseWrapping: true});
   b1.addToNode("btn1");
   b1.setDraggable(true);
</script>

After executing the example the button named Draggable Button is created on the HTML page. The button with the help of the Drag&Drop mechanism can be moved to any part of the page.

See also:

Control