【问题标题】:Jquery ui div not draggable on droppedJquery ui div在拖放时不可拖动
【发布时间】:2017-04-18 10:23:45
【问题描述】:

我遇到了问题,当我将外部视频 div 拖放到时间轴中时,它不再可拖动

https://fiddle.jshell.net/surjitsidhu/pzmzc2z7/2/show/

https://fiddle.jshell.net/surjitsidhu/pzmzc2z7/2

我不确定,为什么会结冰

【问题讨论】:

标签: jquery-ui drag-and-drop jquery-ui-draggable


【解决方案1】:

您的代码似乎缺少可拖动的。

查看此代码:

if( dropped.attr( 'id' ) === 'galleryItem' ) {
            //alert("dropped if");
            var newEl = $( dropped ).clone().appendTo( droppedOn );

            newEl.removeAttr( 'id' ).removeClass( 'thumb' ).html( '<div style="background:red;width:400px;height:50px;"></div>' ).addClass( 'layer-item' );
            newEl.removeClass( 'dragging' );

            newEl.addClass("item");
            $(".item").removeClass("ui-draggable draggable");
            $(".item").draggable({
                cursor: 'move',     
            });

        } else {
            //alert("dropped else");
            $( dropped ).detach().css( { top: 0, left: ui.helper.position().left - 160 } ).appendTo( droppedOn );
        }

【讨论】:

    猜你喜欢
    • 2012-04-02
    • 1970-01-01
    • 2013-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-07
    • 1970-01-01
    相关资源
    最近更新 更多