setDraggable(value: Boolean);
value. Indicates whether a component can be dragged.
The setDraggable method determines whether a component can be dragged on the HTML page.
Available values of the value parameter:
true. A component can be dragged on the HTML page.
false. A component cannot be dragged on the HTML page.
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: