小编str*_*rry的帖子

使用jQuery可排序可调整大小的draggable调整问题大小

我制作了一个可排序,可调整大小,可拖动,带有克隆的portlet,但是当我调整大小时,我遇到了一个bug.

我的剧本:

<script type="text/javascript"> 

$(function() {
    $('#column1').draggable({
        helper:'clone',
        connectToSortable:'#sort',
        handle:'.widget-head',
    });

    $('#sort').sortable({ 
        handle:'.widget-head',
        connectWith: "#sort",
        out: function (e,ui) {
            $("#sort").children().resizable({ axis: 'x',containment: 'parent',
                resize:
                function(event, ui) 
                {
                    ui.size.width = ui.originalSize.width;
                }
            });
        } 
    });
});

</script>
Run Code Online (Sandbox Code Playgroud)

javascript jquery draggable jquery-ui-sortable resizable

2
推荐指数
1
解决办法
3540
查看次数

将javascript函数应用于可拖动副本

我想应用一个名为copie_contenue的函数来改变我在拖动原始文件后创建的副本上的div父ID,但是我的脚本更改了原始文件而不是副本我也尝试了ui.helper代替这个但没有发生任何事情

    $('#model_1').draggable({
    connectToSortable:'#global_div',
    addClasses: false,
    helper:'clone', 
    stop: function(e,ui) {
        $(this).replaceWith(copie_contenue("model_1"));
    }
    })
Run Code Online (Sandbox Code Playgroud)

jquery clone jquery-ui draggable

2
推荐指数
1
解决办法
830
查看次数