解散后,在Boostrap模式中显示并拖动特定元素

问题描述

我正在尝试使用Modal在Bootstrap中制作一个灯箱,一旦选中该元素,即可在其中拖动元素。

到目前为止,我已经有了包含元素的Modal,并且正在使用jQuery draggable(https://jqueryui.com/draggable/)来拖动元素。到目前为止一切顺利。

但是,当我想将元素从模态中拖出时,一旦模态关闭,我就无法保留该元素,它会与模态一起消失。

         $(".user_image_preview").draggable({
                start: function( event,ui ) {
                    console.log('Dragging...');
                    $("#new_image_modal").on('hidden.bs.modal',function (e) {
                    }).modal('hide'); <-- this takes away the draggable element too
                },stop: function( event,ui ) {
                    console.log('stop drag')
                    console.log(event.target)
                }
            })

有什么办法可以消除模态但将元素保持在外面吗?

预先感谢...

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)