More information about this topic
Reset database
 | 
Simple Draggable Object
Drag me to anywhere!

protected/modules/UiModule/views/jui/zii_draggable.php


$this->beginWidget('zii.widgets.jui.CJuiDraggable');

echo 'Drag me to anywhere!';

$this->endWidget();
Draggable Object With Constraint in Containment
Drag me

protected/modules/UiModule/views/jui/zii_draggable.php



echo '<div id="xxx" style="width:200px;height:80px;border:1px solid #eee">';
$this->beginWidget('zii.widgets.jui.CJuiDraggable',
        array(
                'options'=>array('containment'=>'#xxx'), //set who is the containment
                 'htmlOptions'=> array(
                         'style'=>'float:left;width:50px;height:50px;border:1px solid #000',
                 )
        )
);

echo 'Drag me';

$this->endWidget();

echo '</div>';
References
Fork me on GitHub