Control.setDraggable

Syntax

setDraggable (value: Boolean);

Parameters

value. Determines if the component can be dragged: true - it can, false - cannot.

Description

The setDraggable method determines whether it is possible to drag component on the HTML page.

Example

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

Create a button that is an 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 with the Draggable Button inscription 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