Search code examples
twitter-bootstrapyiiyii-extensions

Making yiistrap modal window draggable


How can I make yiistrap modal window draggable using jquery ui? I know how to do it for bootstrap but how should I make changes for yiistrap? In bootstrap it is like this

$("#myModal").draggable({
handle: ".modal-header"
});

Solution

  • I found answer to my problem and thus I am posting my code for making modal window draggable in yiistrap. I hope it will be helpful to others also.

    <?php $this->beginWidget('bootstrap.widgets.TbModal', array(
        'id'=>'myModal',
        'fade' => false,
        'htmlOptions' => array('style' => 'width: 1253px; margin-left: -646px; margin-top: -95px; left: 610px; height: 648px'),
        'options' => array('backdrop' => 'static', 'keyboard' => true)
        )); 
    ?>
    <script>
    $(function(){$("#myModal").draggable().resizable();});
    </script>
    //Modal Header Part
    //Modal Body Part
    //Modal Footer Part
    

    Don't forget to include jquery-ui.css.